Bug 1308631 - UpdateService: Do not apply update without update path. r=Grisha, a=gchang
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 17 Oct 2016 11:19:14 +0200
changeset 356171 ee8df4e3521848a5a2a0c05065ba9db368219843
parent 356170 b03f083b880e7b1bc3781c99f9d27ea21464b532
child 356172 4c19046136f70c214df58fd09db5c52d8e550c4d
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGrisha, gchang
bugs1308631
milestone51.0a2
Bug 1308631 - UpdateService: Do not apply update without update path. r=Grisha, a=gchang Update path can be null. In this case we fallback to using the last saved path. However if this doesn't exist either then we just continue with a null path and eventually crash the service. MozReview-Commit-ID: Kuihp496TEo
mobile/android/base/java/org/mozilla/gecko/updater/UpdateService.java
--- a/mobile/android/base/java/org/mozilla/gecko/updater/UpdateService.java
+++ b/mobile/android/base/java/org/mozilla/gecko/updater/UpdateService.java
@@ -657,17 +657,20 @@ public class UpdateService extends Inten
 
         return true;
     }
 
     private void applyUpdate(String updatePath) {
         if (updatePath == null) {
             updatePath = getLastFileName();
         }
-        applyUpdate(new File(updatePath));
+
+        if (updatePath != null) {
+            applyUpdate(new File(updatePath));
+        }
     }
 
     private void applyUpdate(File updateFile) {
         mApplyImmediately = false;
 
         if (!updateFile.exists())
             return;