Bug 1192433: Return an empty list rather than throwing an error when attempting to read a directory in an app: URL (fixes M1 bustage). r=trivial
authorKris Maglione <maglione.k@gmail.com>
Thu, 05 Nov 2015 20:13:19 -0800
changeset 293144 f103f2fdbe131ec3c4f5423588bafb0294d52bf3
parent 293143 db44f45662a88375bdda28c81486d0570d3f79cb
child 293145 adf257bef068a9efd0ce79d479c1f9d174eebe99
push id8824
push userraliiev@mozilla.com
push dateMon, 14 Dec 2015 20:18:56 +0000
treeherdermozilla-aurora@e2031358e2a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstrivial
bugs1192433
milestone45.0a1
Bug 1192433: Return an empty list rather than throwing an error when attempting to read a directory in an app: URL (fixes M1 bustage). r=trivial
toolkit/components/extensions/Extension.jsm
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -476,17 +476,19 @@ ExtensionData.prototype = {
 
       // Always return a list, even if the directory does not exist (or is
       // not a directory) for symmetry with the ZipReader behavior.
       return results;
     }
 
     if (!(this.rootURI instanceof Ci.nsIJARURI &&
           this.rootURI.JARFile instanceof Ci.nsIFileURL)) {
-      throw Error("Invalid extension root URL");
+      // This currently happens for app:// URLs passed to us by
+      // UserCustomizations.jsm
+      return [];
     }
 
     // FIXME: We need a way to do this without main thread IO.
 
     let file = this.rootURI.JARFile.file;
     let zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(Ci.nsIZipReader);
     try {
       zipReader.open(file);