Bug 420356, Ship blocklist.xml with Firefox (SeaMonkey tunit failure fix). r=gavin
authorCallek@gmail.com
Wed, 19 Mar 2008 23:31:20 -0700
changeset 13373 a8f536ad17ee9fb2230085e9b8e17ab859ea9bfc
parent 13372 6c358454dcd270cfb4fdad5fc1a25e2f856f5ac8
child 13374 3436cc9623c87d3f4960749b08b47eab03d04617
push idunknown
push userunknown
push dateunknown
reviewersgavin
bugs420356
milestone1.9b5pre
Bug 420356, Ship blocklist.xml with Firefox (SeaMonkey tunit failure fix). r=gavin
toolkit/mozapps/extensions/src/nsBlocklistService.js
--- a/toolkit/mozapps/extensions/src/nsBlocklistService.js
+++ b/toolkit/mozapps/extensions/src/nsBlocklistService.js
@@ -399,24 +399,29 @@ Blocklist.prototype = {
         statusText);
   },
 
   /**
    * Finds the newest blocklist file from the application and the profile and
    * load it or does nothing if neither exist.
    */
   _loadBlocklist: function() {
+    this._addonEntries = { };
+    this._pluginEntries = { };
     var profFile = getFile(KEY_PROFILEDIR, [FILE_BLOCKLIST]);
     if (profFile.exists()) {
       this._loadBlocklistFromFile(profFile);
       return;
     }
     var appFile = getFile(KEY_APPDIR, [FILE_BLOCKLIST]);
-    if (appFile.exists())
+    if (appFile.exists()) {
       this._loadBlocklistFromFile(appFile);
+      return;
+    }
+    LOG("Blocklist::_loadBlocklist: no XML File found");
   },
 
   /**
 #    The blocklist XML file looks something like this:
 #
 #    <blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist">
 #      <emItems>
 #        <emItem id="item_1@domain">
@@ -462,18 +467,16 @@ Blocklist.prototype = {
 #          <match name="name" exp="some plugin"/>
 #          <match name="description" exp="1[.]2[.]3"/>
 #        </pluginItem>
 #      </pluginItems>
 #    </blocklist>
    */
 
   _loadBlocklistFromFile: function(file) {
-    this._addonEntries = { };
-    this._pluginEntries = { };
     if (getPref("getBoolPref", PREF_BLOCKLIST_ENABLED, true) == false) {
       LOG("Blocklist::_loadBlocklistFromFile: blocklist is disabled");
       return;
     }
 
     if (!file.exists()) {
       LOG("Blocklist::_loadBlocklistFromFile: XML File does not exist");
       return;