Skip to content

Commit

Permalink
Make sure the scanner object is available when calling 'stop' #235
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Feb 26, 2020
1 parent edafe47 commit ee41e3e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion demo/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
},
"homepage": "https://github.com/NativeScript/template-hello-world-ts",
"android": {
"v8Flags": "--expose_gc"
"v8Flags": "--expose_gc",
"markingMode": "none"
},
"devDependencies": {
"nativescript-dev-typescript": "^0.3.0"
Expand Down
4 changes: 3 additions & 1 deletion src/barcodescanner.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ export class BarcodeScanner {
try {
this.close();
this._removeVolumeObserver();
this._scanner.stopScanning();
if (this._scanner) {
this._scanner.stopScanning();
}
this._closeCallback && this._closeCallback();
resolve();
} catch (ex) {
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-barcodescanner",
"version": "3.4.1",
"version": "3.4.2",
"description": "Scan QR/barcodes with your NativeScript app.",
"main": "barcodescanner",
"typings": "index.d.ts",
Expand Down

0 comments on commit ee41e3e

Please sign in to comment.