OSDN Git Service

camera: fix NullPointerException
authorChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 20 Feb 2013 17:46:17 +0000 (01:46 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 25 Sep 2013 02:45:42 +0000 (10:45 +0800)
core/java/android/hardware/Camera.java

index 4e51080..e656792 100644 (file)
@@ -3639,6 +3639,8 @@ public class Camera {
                 return Float.parseFloat(mMap.get(key));
             } catch (NumberFormatException ex) {
                 return defaultValue;
+            } catch (NullPointerException ex) {
+                return defaultValue;
             }
         }
 
@@ -3648,6 +3650,8 @@ public class Camera {
                 return Integer.parseInt(mMap.get(key));
             } catch (NumberFormatException ex) {
                 return defaultValue;
+            } catch (NullPointerException ex) {
+                return defaultValue;
             }
         }