react-native-scanbot-barcode-scanner-sdk 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Libraries.txt
CHANGED
package/android/src/main/java/io/scanbot/barcodesdk/plugin/reactnative/ScanbotBarcodeSdkModule.java
CHANGED
|
@@ -99,6 +99,9 @@ public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule implemen
|
|
|
99
99
|
public void initializeSdk(final ReadableMap options, final Promise promise) {
|
|
100
100
|
debugLog("Initializing Scanbot SDK ...");
|
|
101
101
|
this.threadPool.execute(() -> {
|
|
102
|
+
if (promise == null) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
102
105
|
try {
|
|
103
106
|
final ScanbotBarcodeSdkConfiguration configuration = new ScanbotBarcodeSdkConfiguration();
|
|
104
107
|
safeMap(options, configuration, promise);
|
|
@@ -187,6 +190,9 @@ public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule implemen
|
|
|
187
190
|
return;
|
|
188
191
|
}
|
|
189
192
|
this.threadPool.execute(() -> {
|
|
193
|
+
if (promise == null) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
190
196
|
try {
|
|
191
197
|
final String imageUri = options.getString("imageFileUri");
|
|
192
198
|
|
|
@@ -354,6 +360,9 @@ public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule implemen
|
|
|
354
360
|
return;
|
|
355
361
|
}
|
|
356
362
|
threadPool.execute(() -> {
|
|
363
|
+
if (promise == null) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
357
366
|
try {
|
|
358
367
|
|
|
359
368
|
debugLog("Cleaning Barcode SDK storage folder ...");
|
|
@@ -382,9 +391,13 @@ public class ScanbotBarcodeSdkModule extends ReactContextBaseJavaModule implemen
|
|
|
382
391
|
public void onNewIntent(Intent intent) {}
|
|
383
392
|
|
|
384
393
|
private void handleBarcodeScannerActivityCompletion(final Intent intent, final int resultCode) {
|
|
385
|
-
Promise promise = this.activityCallbackPromise;
|
|
394
|
+
final Promise promise = this.activityCallbackPromise;
|
|
386
395
|
this.activityCallbackPromise = null;
|
|
387
396
|
|
|
397
|
+
if (promise == null) {
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
|
|
388
401
|
final BarcodeScannerActivity.Result barcodeResult = BarcodeScannerActivity.extractResult(resultCode, intent);
|
|
389
402
|
|
|
390
403
|
if (barcodeResult.getResultOk()) {
|