Bug 1364878: Fix add-on path migration issues. r?aswan draft
authorKris Maglione <maglione.k@gmail.com>
Mon, 15 May 2017 09:21:58 -0700
changeset 577918 fe0fd540e08f416f54f50bcd77aa270d734d28b2
parent 577917 20c570b957c61061b1353dbd2ab6aa7f5376dea2
child 628624 9f2bd5b873ed353803d29610101a32f4174ca6ce
push id58824
push usermaglione.k@gmail.com
push dateMon, 15 May 2017 16:22:18 +0000
reviewersaswan
bugs1364878
milestone55.0a1
Bug 1364878: Fix add-on path migration issues. r?aswan MozReview-Commit-ID: JuPz1MoZlcj
toolkit/mozapps/extensions/internal/XPIProviderUtils.js
--- a/toolkit/mozapps/extensions/internal/XPIProviderUtils.js
+++ b/toolkit/mozapps/extensions/internal/XPIProviderUtils.js
@@ -497,16 +497,19 @@ this.XPIDatabase = {
         // force the DB to save so that the DB_SCHEMA value in the JSON file and
         // the preference are updated.
       }
       // If we got here, we probably have good data
       // Make AddonInternal instances from the loaded data and save them
       let addonDB = new Map();
       for (let loadedAddon of inputAddons.addons) {
         try {
+          if (!loadedAddon.path) {
+            loadedAddon.path = descriptorToPath(loadedAddon.descriptor);
+          }
           loadedAddon._sourceBundle = new nsIFile(loadedAddon.path);
         } catch (e) {
           // We can fail here when the path is invalid, usually from the
           // wrong OS
           logger.warn("Could not find source bundle for add-on " + loadedAddon.id, e);
         }
 
         let newAddon = new DBAddonInternal(loadedAddon);