From 7c16f2ca3a00dbc8fe57f8ff5822c2439a5545b6 Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Thu, 28 Jul 2022 17:57:09 +0100 Subject: [PATCH 1/2] NullPointerException fix when customPaperFilePath is null --- package.json | 2 +- plugin.xml | 2 +- src/android/BrotherPrinter.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 433ebc5..b513b5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-brother-label-printer", - "version": "1.6.0", + "version": "1.6.1", "description": "Cordova plugin for brother label printers", "cordova": { "id": "cordova-plugin-brother-label-printer", diff --git a/plugin.xml b/plugin.xml index 6b25913..1a9419d 100644 --- a/plugin.xml +++ b/plugin.xml @@ -3,7 +3,7 @@ + version="1.6.1"> BrotherPrinter diff --git a/src/android/BrotherPrinter.java b/src/android/BrotherPrinter.java index dd9f9f7..0041e93 100644 --- a/src/android/BrotherPrinter.java +++ b/src/android/BrotherPrinter.java @@ -394,7 +394,7 @@ private void setPrinter(JSONArray args, final CallbackContext callbackctx) { editor.putString("orientation", printer.orientation != null ? printer.orientation : PrinterInfo.Orientation.LANDSCAPE.toString()); editor.putString("numberOfCopies", printer.numberOfCopies); - if(!printer.customPaperFilePath.isEmpty()) { + if(printer.customPaperFilePath != null && !printer.customPaperFilePath.isEmpty()) { String targetBinFolder = cordova.getActivity() .getExternalFilesDir("customPaperFileSet/").toString(); copyBinFile("www/" + printer.customPaperFilePath, targetBinFolder); From c2a6cfb14045ba65f6c14f48aed07f81db113880 Mon Sep 17 00:00:00 2001 From: Arcadius Ahouansou Date: Thu, 28 Jul 2022 18:06:54 +0100 Subject: [PATCH 2/2] NullPointerException fix when customPaperFilePath is null + readme update --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 0202416..8e06bad 100644 --- a/README.md +++ b/README.md @@ -243,3 +243,10 @@ interface Printer { } ``` + +## iOS notes: +* You may get errors while compiling: you need to make sure the native lib is "embed and sign" . + see https://github.com/MenelicSoftware/cordova-plugin-brother-label-printer/issues/39 + +* If you are getting errors about unsupported architectures, please look at + http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/ \ No newline at end of file