diff --git a/QRCodeReaderView-lib/qrcodereaderview/src/main/java/com/dlazaro66/qrcodereaderview/QRCodeReaderView.java b/QRCodeReaderView-lib/qrcodereaderview/src/main/java/com/dlazaro66/qrcodereaderview/QRCodeReaderView.java index f2108b4..3f37bcd 100644 --- a/QRCodeReaderView-lib/qrcodereaderview/src/main/java/com/dlazaro66/qrcodereaderview/QRCodeReaderView.java +++ b/QRCodeReaderView-lib/qrcodereaderview/src/main/java/com/dlazaro66/qrcodereaderview/QRCodeReaderView.java @@ -93,7 +93,9 @@ private void init() { mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); // Need to set this flag despite it's deprecated } else { Log.e(TAG, "Error: Camera not found"); - mOnQRCodeReadListener.cameraNotFound(); + if (mOnQRCodeReadListener != null) { + mOnQRCodeReadListener.cameraNotFound(); + } } }