Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException: Attempt to get length of null array at SourceData #268

Closed
PaulWoitaschek opened this issue Jan 17, 2017 · 3 comments
Closed

Comments

@PaulWoitaschek
Copy link
Contributor

Version 3.4.0
Samsung GT-I9505, API 21

I'm seeing this crash on a samsung device because the byte array passed from onPreviewFrame is null.
A simple null check in the library should do it.

 Exception java.lang.NullPointerException: Attempt to get length of null array
at com.journeyapps.barcodescanner.SourceData.<init> (SourceFile:50)
at com.journeyapps.barcodescanner.camera.CameraManager$CameraPreviewCallback.onPreviewFrame (SourceFile:101)
at android.hardware.Camera$EventHandler.handleMessage (Camera.java:1160)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:145)
at android.os.HandlerThread.run (HandlerThread.java:6)
@PaulWoitaschek
Copy link
Contributor Author

Thanks!

@ghost
Copy link

ghost commented Jun 9, 2021

Process: gotoxy.com.myapplication, PID: 9587
java.lang.NullPointerException: Attempt to get length of null array
at gotoxy.com.myapplication.RecordListAdapter.getView(RecordListAdapter.java:74)

alguem ja viu esse error

@ghost
Copy link

ghost commented Jun 9, 2021

Bitmap bitmap = BitmapFactory.decodeByteArray(recordImage,0,recordImage.length);
holder.imageView.setImageBitmap(bitmap); ele aponta aqui

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

No branches or pull requests

1 participant