Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Commit

Permalink
fix(android): Update Camera1 to not crash on invalid ratio (#2501)
Browse files Browse the repository at this point in the history
Setting a property ends up with an unhandled exception that cannot be caught easily by RN. This should also make the behaviour consistent with camera startup and Camera2.
  • Loading branch information
cristianoccazinsp authored and sibelius committed Sep 24, 2019
1 parent 38a5ffb commit 702f608
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ boolean setAspectRatio(AspectRatio ratio) {
} else if (!mAspectRatio.equals(ratio)) {
final Set<Size> sizes = mPreviewSizes.sizes(ratio);
if (sizes == null) {
throw new UnsupportedOperationException(ratio + " is not supported");
// do nothing, ratio remains unchanged. Consistent with Camera2 and initial mount behaviour
} else {
mAspectRatio = ratio;
adjustCameraParameters();
Expand Down

0 comments on commit 702f608

Please sign in to comment.