Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

NPE App crashes when going back from ScannerPage to the parentPage #76

Open
Tebra opened this issue Mar 14, 2018 · 0 comments
Open

NPE App crashes when going back from ScannerPage to the parentPage #76

Tebra opened this issue Mar 14, 2018 · 0 comments

Comments

@Tebra
Copy link

Tebra commented Mar 14, 2018

The App crashes when the ScanPage is in the OnDissapearing method and is setting the IsEnabled=false variable on slower devices.

The following exception was thrown:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.hardware.Camera.addCallbackBuffer(byte[])' on a null object

So the issue is in the following class on line 814:
https://github.com/rebuy-de/rb-forms-barcode/blob/master/RebuyCameraSource/RebuyCameraSource/src/main/java/com/rebuy/play/services/vision/CameraSource.java

Can you please fix this and deploy a new version on nuget.

The fix could look like:

            // The code below needs to run outside of synchronization, because this will allow
            // the camera to add pending frame(s) while we are running detection on the current
            // frame.

            try {
                mDetector.receiveFrame(outputFrame);
            } catch (Throwable t) {
                Log.e(TAG, "Exception thrown from receiver.", t);
            } finally {
                if(mCamera != null && data != null && data.array != null) {
                    mCamera.addCallbackBuffer(data.array());
                }
            }

Thanks in advance!

Best regards

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant