diff --git a/src/main/java/com/budiyev/android/codescanner/CodeScanner.java b/src/main/java/com/budiyev/android/codescanner/CodeScanner.java index 035de88..5bb45a3 100644 --- a/src/main/java/com/budiyev/android/codescanner/CodeScanner.java +++ b/src/main/java/com/budiyev/android/codescanner/CodeScanner.java @@ -628,6 +628,9 @@ private FinishInitializationTask(@NonNull Point frameSize) { @Override public void run() { + if (!mInitialized) { + return; + } mScannerView.setFrameSize(mFrameSize); mScannerView.setCodeScanner(CodeScanner.this); startPreview();