Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c17aa29 authored by Steve Kondik's avatar Steve Kondik
Browse files

camera: Tolerate errors in getHorizontal/VerticalViewAngle

 * Don't try to parse "nan"

Change-Id: I5fdfc3055b0c8514c3848ae3c26788478bfda9ae
parent 45c9f848
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -3795,7 +3795,12 @@ public class Camera {
         *         valid value.
         */
        public float getHorizontalViewAngle() {
            try {
                return Float.parseFloat(get(KEY_HORIZONTAL_VIEW_ANGLE));
            } catch (NumberFormatException e) {
                Log.e(TAG, e.getMessage(), e);
            }
            return 0;
        }

        /**
@@ -3805,7 +3810,12 @@ public class Camera {
         *         valid value.
         */
        public float getVerticalViewAngle() {
            try {
                return Float.parseFloat(get(KEY_VERTICAL_VIEW_ANGLE));
            } catch (NumberFormatException e) {
                Log.e(TAG, e.getMessage(), e);
            }
            return 0;
        }

        /**