Bug 904551 - Check for null uri received from camera image requests. r=lucasr, a=lsblakk
authorWes Johnston <wjohnston@mozilla.com>
Fri, 01 Nov 2013 12:21:33 -0700
changeset 167319 ee03911b8e1ded49efc2e3253b50ee8fdff39d51
parent 167318 4c4bd25aeaed49208eab789197311c00728b9454
child 167320 c24b1290afa9ea196e928389fe3a8e8f128da1d5
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, lsblakk
bugs904551
milestone27.0a2
Bug 904551 - Check for null uri received from camera image requests. r=lucasr, a=lsblakk
mobile/android/base/CameraVideoResultHandler.java
--- a/mobile/android/base/CameraVideoResultHandler.java
+++ b/mobile/android/base/CameraVideoResultHandler.java
@@ -36,17 +36,18 @@ class CameraVideoResultHandler implement
             mFilePickerResult.offer(res);
 
         if (mHandler != null)
             mHandler.gotFile(res);
     }
 
     @Override
     public void onActivityResult(int resultCode, Intent data) {
-        if (data == null || resultCode != Activity.RESULT_OK) {
+        // Intent.getData() can return null. Avoid a crash. See bug 904551.
+        if (data == null || data.getData() == null || resultCode != Activity.RESULT_OK) {
             sendResult("");
             return;
         }
 
         Cursor cursor = GeckoAppShell.getGeckoInterface().getActivity().managedQuery(data.getData(),
                 new String[] { MediaStore.Video.Media.DATA },
                 null,
                 null,