Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Nullpointer when setting picture size parameter in Camera1 #207

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Nullpointer when setting picture size parameter in Camera1 #207

wants to merge 1 commit into from

Conversation

jamesbluecrow
Copy link

The camera crashes in some devices running Android 5.1. This is the issue to track it: #72

Caused by java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.SortedSet.last()' on a null object reference
       at com.google.android.cameraview.Camera1.adjustCameraParameters(Camera1.java:349)
       at com.google.android.cameraview.Camera1.setAspectRatio(Camera1.java:168)
       at com.google.android.cameraview.CameraView.setAspectRatio(CameraView.java:335)

The reason is that we try to access the last PictureSizes item for an AspectRatio and there is no such size for that aspect ratio.

In those case we should be defaulting to the PreviewSizes

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

Successfully merging this pull request may close these issues.

2 participants