Bug 1130052 - Try avoid NPE, return from onHandleIntent if null intent. r=vng, a=sledru
authorGarvan Keeley <gkeeley@mozilla.com>
Fri, 06 Feb 2015 13:30:31 -0800
changeset 243721 130e59d97b15
parent 243720 cb5d2bbf9234
child 243722 a9eec576bb2c
push id4449
push userryanvm@gmail.com
push date2015-02-09 15:46 +0000
treeherdermozilla-beta@130e59d97b15 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvng, sledru
bugs1130052
milestone36.0
Bug 1130052 - Try avoid NPE, return from onHandleIntent if null intent. r=vng, a=sledru
mobile/android/stumbler/java/org/mozilla/mozstumbler/service/uploadthread/UploadAlarmReceiver.java
--- a/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/uploadthread/UploadAlarmReceiver.java
+++ b/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/uploadthread/UploadAlarmReceiver.java
@@ -43,18 +43,20 @@ public class UploadAlarmReceiver extends
         }
 
         public UploadAlarmService() {
             super(LOG_TAG);
         }
 
         @Override
         protected void onHandleIntent(Intent intent) {
-            // Default to a repeating alarm, which is what Fennec Stumbler uses
-            boolean isRepeating = (intent == null)? true : intent.getBooleanExtra(EXTRA_IS_REPEATING, true);
+            if (intent == null) {
+                return;
+            }
+            boolean isRepeating = intent.getBooleanExtra(EXTRA_IS_REPEATING, true);
             if (DataStorageManager.getInstance() == null) {
                 DataStorageManager.createGlobalInstance(this, null);
             }
             upload(isRepeating);
         }
 
         void upload(boolean isRepeating) {
             if (!isRepeating) {