This doesn't seem to happen very often, but over the last 90 days I see 6 crashes where our onPictureTaken callback throws an NPE because we had assumed this to be @NotNull. All of these occurred on 4.x versions (4.2.2, 4.0.4, and 4.3 in descending order of occurrences). I'm guessing that the intent of this callback is to never have null data, so there must be a bug somewhere in the Camera1 code. Since it's just passing along the results of https://developer.android.com/reference/android/hardware/Camera.PictureCallback.html#onPictureTaken(byte[],%20android.hardware.Camera), which does not make any claims about the nullity of the data, I suspect the best approach would be to either ignore if the data is null, or attempt a retry. Opinions?
This doesn't seem to happen very often, but over the last 90 days I see 6 crashes where our
onPictureTaken
callback throws an NPE because we had assumed this to be@NotNull
. All of these occurred on 4.x versions (4.2.2, 4.0.4, and 4.3 in descending order of occurrences). I'm guessing that the intent of this callback is to never have null data, so there must be a bug somewhere in the Camera1 code. Since it's just passing along the results of https://developer.android.com/reference/android/hardware/Camera.PictureCallback.html#onPictureTaken(byte[],%20android.hardware.Camera), which does not make any claims about the nullity of the data, I suspect the best approach would be to either ignore if the data is null, or attempt a retry. Opinions?