Skip to content

Commit

Permalink
Merge pull request google#19 from NashLegend/master
Browse files Browse the repository at this point in the history
getHighResolutionOutputSizes() cause NPE
  • Loading branch information
yaraki authored Sep 21, 2016
2 parents 3e87fe3 + 4b52bc8 commit 906c4da
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,11 @@ private void collectCameraInfo() {
mPictureSizes.clear();
// try to get hi-res output sizes for Marshmellow and higher
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
for (android.util.Size size : map.getHighResolutionOutputSizes(ImageFormat.JPEG)) {
mPictureSizes.add(new Size(size.getWidth(), size.getHeight()));
android.util.Size[] outputSizes = map.getHighResolutionOutputSizes(ImageFormat.JPEG);
if (outputSizes != null) {
for (android.util.Size size : map.getHighResolutionOutputSizes(ImageFormat.JPEG)) {
mPictureSizes.add(new Size(size.getWidth(), size.getHeight()));
}
}
}
// fallback camera sizes and lower than Marshmellow
Expand Down

0 comments on commit 906c4da

Please sign in to comment.