Bug 1308631 - UpdateService: Do not apply update without update path. r?grisha draft
authorSebastian Kaspari <s.kaspari@gmail.com>
Mon, 17 Oct 2016 11:19:14 +0200
changeset 425843 55c53000741add4c5b91059fab48028ec3765d0f
parent 425838 c144d749a3a2dbab6618f4b1df478a6e624f4bd4
child 534008 6cdf513f4ef27c374c660cc9d080de4460dc30f1
push id32528
push users.kaspari@gmail.com
push dateMon, 17 Oct 2016 09:19:55 +0000
reviewersgrisha
bugs1308631
milestone52.0a1
Bug 1308631 - UpdateService: Do not apply update without update path. r?grisha 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;