Skip to content

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

@PaulWoitaschek

Description

@PaulWoitaschek

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions