diff --git a/1.hello-world/1.hello-world.html b/1.hello-world/1.hello-world.html index 5951f8c7..a49ca380 100644 --- a/1.hello-world/1.hello-world.html +++ b/1.hello-world/1.hello-world.html @@ -64,7 +64,7 @@ await scanner.show(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/11.read-video-requirejs.html b/1.hello-world/11.read-video-requirejs.html index 7fcf1b2e..d6359fe7 100644 --- a/1.hello-world/11.read-video-requirejs.html +++ b/1.hello-world/11.read-video-requirejs.html @@ -64,7 +64,7 @@

Hello World for RequireJS

await scanner.show(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/12.read-video-es6.html b/1.hello-world/12.read-video-es6.html index 0ed344a7..c14f1c0d 100644 --- a/1.hello-world/12.read-video-es6.html +++ b/1.hello-world/12.read-video-es6.html @@ -62,7 +62,7 @@

Hello World for ES6

await scanner.show(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/14.read-video-webview/android/app/src/main/assets/decodeBarcodeInVideo.html b/1.hello-world/14.read-video-webview/android/app/src/main/assets/decodeBarcodeInVideo.html index 480cb1ca..7630c2bd 100644 --- a/1.hello-world/14.read-video-webview/android/app/src/main/assets/decodeBarcodeInVideo.html +++ b/1.hello-world/14.read-video-webview/android/app/src/main/assets/decodeBarcodeInVideo.html @@ -57,7 +57,7 @@ await scanner.show(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/14.read-video-webview/ios/dbrjswebview/html/decodeFileInVideo.html b/1.hello-world/14.read-video-webview/ios/dbrjswebview/html/decodeFileInVideo.html index ebdd0fbd..88a491ab 100644 --- a/1.hello-world/14.read-video-webview/ios/dbrjswebview/html/decodeFileInVideo.html +++ b/1.hello-world/14.read-video-webview/ios/dbrjswebview/html/decodeFileInVideo.html @@ -56,7 +56,7 @@ await scanner.show(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/2.read-an-image.html b/1.hello-world/2.read-an-image.html index e4fe6c7f..32c02ab2 100644 --- a/1.hello-world/2.read-an-image.html +++ b/1.hello-world/2.read-an-image.html @@ -58,7 +58,7 @@

Read Barcode from Images

document.getElementById('p-loading').innerText = ex; document.getElementById('ipt-file').disabled = true; let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; @@ -110,7 +110,7 @@

Read Barcode from Images

divResults.scrollTop = divResults.scrollHeight; } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/3.read-video-angular/README.md b/1.hello-world/3.read-video-angular/README.md index e2187142..6e37ff80 100644 --- a/1.hello-world/3.read-video-angular/README.md +++ b/1.hello-world/3.read-video-angular/README.md @@ -89,7 +89,7 @@ export class VideoDecodeComponent implements OnInit { await scanner.open(); } catch (ex: any) { let errMsg; - if (ex?.message.includes('network connection error')) { + if (ex.message?.includes('network connection error')) { errMsg = 'Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.'; } else { @@ -159,7 +159,7 @@ export class ImgDecodeComponent implements OnInit { if (!results.length) { alert('No barcode found'); } } catch (ex: any) { let errMsg; - if (ex?.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; @@ -257,7 +257,7 @@ export class HelloWorldComponent implements OnInit { await BarcodeScanner.loadWasm(); } catch (ex: any) { let errMsg; - if (ex?.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/3.read-video-angular/src/app/hello-world/hello-world.component.ts b/1.hello-world/3.read-video-angular/src/app/hello-world/hello-world.component.ts index eab41099..06ebc284 100644 --- a/1.hello-world/3.read-video-angular/src/app/hello-world/hello-world.component.ts +++ b/1.hello-world/3.read-video-angular/src/app/hello-world/hello-world.component.ts @@ -16,7 +16,7 @@ export class HelloWorldComponent implements OnInit { await BarcodeScanner.loadWasm(); } catch (ex: any) { let errMsg; - if (ex?.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/3.read-video-angular/src/app/img-decode/img-decode.component.ts b/1.hello-world/3.read-video-angular/src/app/img-decode/img-decode.component.ts index 62ef1f45..c87b6967 100644 --- a/1.hello-world/3.read-video-angular/src/app/img-decode/img-decode.component.ts +++ b/1.hello-world/3.read-video-angular/src/app/img-decode/img-decode.component.ts @@ -23,7 +23,7 @@ export class ImgDecodeComponent implements OnInit { if (!results.length) { alert('No barcode found'); } } catch (ex: any) { let errMsg; - if (ex?.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/3.read-video-angular/src/app/video-decode/video-decode.component.ts b/1.hello-world/3.read-video-angular/src/app/video-decode/video-decode.component.ts index 84fcc838..2c67cfb8 100644 --- a/1.hello-world/3.read-video-angular/src/app/video-decode/video-decode.component.ts +++ b/1.hello-world/3.read-video-angular/src/app/video-decode/video-decode.component.ts @@ -25,7 +25,7 @@ export class VideoDecodeComponent implements OnInit { await scanner.open(); } catch (ex: any) { let errMsg; - if (ex?.message.includes('network connection error')) { + if (ex.message?.includes('network connection error')) { errMsg = 'Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license.'; } else { diff --git a/1.hello-world/5.read-video-vue/README.md b/1.hello-world/5.read-video-vue/README.md index 0ad44688..3b25beba 100644 --- a/1.hello-world/5.read-video-vue/README.md +++ b/1.hello-world/5.read-video-vue/README.md @@ -136,7 +136,7 @@ export default { await scanner.open(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; @@ -310,7 +310,7 @@ export default { if (!results.length) { alert('No barcode found'); } } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; @@ -379,7 +379,7 @@ export default { await BarcodeReader.loadWasm(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/5.read-video-vue/src/components/HelloWorld.vue b/1.hello-world/5.read-video-vue/src/components/HelloWorld.vue index e8926bd7..3f438a2c 100644 --- a/1.hello-world/5.read-video-vue/src/components/HelloWorld.vue +++ b/1.hello-world/5.read-video-vue/src/components/HelloWorld.vue @@ -34,7 +34,7 @@ export default { await BarcodeReader.loadWasm(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/5.read-video-vue/src/components/ImgDecode.vue b/1.hello-world/5.read-video-vue/src/components/ImgDecode.vue index 59192dac..05888dc3 100644 --- a/1.hello-world/5.read-video-vue/src/components/ImgDecode.vue +++ b/1.hello-world/5.read-video-vue/src/components/ImgDecode.vue @@ -22,7 +22,7 @@ export default { if (!results.length) { alert('No barcode found'); } } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/5.read-video-vue/src/components/VideoDecode.vue b/1.hello-world/5.read-video-vue/src/components/VideoDecode.vue index 598e5886..9e130a35 100644 --- a/1.hello-world/5.read-video-vue/src/components/VideoDecode.vue +++ b/1.hello-world/5.read-video-vue/src/components/VideoDecode.vue @@ -86,7 +86,7 @@ export default { await scanner.open(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/1.hello-world/9.read-video-electron/action.js b/1.hello-world/9.read-video-electron/action.js index 5a77797a..514a8b57 100644 --- a/1.hello-world/9.read-video-electron/action.js +++ b/1.hello-world/9.read-video-electron/action.js @@ -28,7 +28,7 @@ await scanner.show(); } catch (ex) { let errMsg; - if (ex?.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/2.ui-tweaking/1.read-video-show-result.html b/2.ui-tweaking/1.read-video-show-result.html index 3bdfb0a9..9a2b273e 100644 --- a/2.ui-tweaking/1.read-video-show-result.html +++ b/2.ui-tweaking/1.read-video-show-result.html @@ -54,7 +54,7 @@

Use the Default Built-in UI

startBarcodeScanner(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; @@ -105,7 +105,7 @@

Use the Default Built-in UI

document.getElementById('results').style.visibility = "visible"; } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/2.ui-tweaking/2.read-video-no-extra-control.html b/2.ui-tweaking/2.read-video-no-extra-control.html index 1d5cb14e..4d30c0b0 100644 --- a/2.ui-tweaking/2.read-video-no-extra-control.html +++ b/2.ui-tweaking/2.read-video-no-extra-control.html @@ -54,7 +54,7 @@

Hide UI Controls

showScanner(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; @@ -81,7 +81,7 @@

Hide UI Controls

document.getElementById('lib-load').hidden = true; } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/2.ui-tweaking/3.read-video-with-external-control.html b/2.ui-tweaking/3.read-video-with-external-control.html index 7c193be0..8d3022ea 100644 --- a/2.ui-tweaking/3.read-video-with-external-control.html +++ b/2.ui-tweaking/3.read-video-with-external-control.html @@ -113,7 +113,7 @@

Customized UI

await Dynamsoft.DBR.BarcodeReader.loadWasm(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; @@ -144,7 +144,7 @@

Customized UI

updateCurrentResolution(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/2.ui-tweaking/4.difference-video-size.html b/2.ui-tweaking/4.difference-video-size.html index 0b2c5028..bfbcf891 100644 --- a/2.ui-tweaking/4.difference-video-size.html +++ b/2.ui-tweaking/4.difference-video-size.html @@ -57,7 +57,7 @@

Enlarge the Video Stream

showScanner(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; @@ -109,7 +109,7 @@

Enlarge the Video Stream

document.getElementById('result').hidden = false; } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/2.ui-tweaking/5.read-video-with-custom-default-ui.html b/2.ui-tweaking/5.read-video-with-custom-default-ui.html index 66bb205e..b1003a99 100644 --- a/2.ui-tweaking/5.read-video-with-custom-default-ui.html +++ b/2.ui-tweaking/5.read-video-with-custom-default-ui.html @@ -114,7 +114,7 @@

Customized Default UI

renderResolutionSelector(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message || ex; diff --git a/3.settings/6.dense-barcodes.html b/3.settings/6.dense-barcodes.html index ab674628..f577aed9 100644 --- a/3.settings/6.dense-barcodes.html +++ b/3.settings/6.dense-barcodes.html @@ -84,7 +84,7 @@ await scanner.open(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { diff --git a/3.settings/initScanner.js b/3.settings/initScanner.js index df608123..567c9e55 100644 --- a/3.settings/initScanner.js +++ b/3.settings/initScanner.js @@ -38,7 +38,7 @@ window.onload = async function () { startReading(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/4.use-case/1.fill-a-form-with-barcode-reading.html b/4.use-case/1.fill-a-form-with-barcode-reading.html index 9df162f9..636a6cc3 100644 --- a/4.use-case/1.fill-a-form-with-barcode-reading.html +++ b/4.use-case/1.fill-a-form-with-barcode-reading.html @@ -89,7 +89,7 @@

Click each input box to fill in!

await scanner.show(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; @@ -103,7 +103,7 @@

Click each input box to fill in!

await Dynamsoft.DBR.BarcodeScanner.loadWasm(); } catch (ex) { let errMsg; - if (ex.message.includes("network connection error")) { + if (ex.message?.includes("network connection error")) { errMsg = "Failed to connect to Dynamsoft License Server: network connection error. Check your Internet connection or contact Dynamsoft Support (support@dynamsoft.com) to acquire an offline license."; } else { errMsg = ex.message||ex; diff --git a/4.use-case/2.read-a-drivers-license.html b/4.use-case/2.read-a-drivers-license.html index 7d9e4bb0..5a686ecb 100644 --- a/4.use-case/2.read-a-drivers-license.html +++ b/4.use-case/2.read-a-drivers-license.html @@ -76,7 +76,7 @@

Read A Driver's License Read A Driver's License