Bug 500976 - PlacesController.prototype._shouldShowMenuItem should not depend on bug 232598. r=sdwilsh
authorDão Gottwald <dao@mozilla.com>
Sun, 28 Jun 2009 18:04:18 +0200
changeset 29791 48161673b084
parent 29790 fd0b25ac9f0d
child 29792 22ed91cb3441
push id106
push userhsivonen@iki.fi
push dateSun, 28 Jun 2009 17:44:42 +0000
reviewerssdwilsh
bugs500976, 232598
milestone1.9.2a1pre
Bug 500976 - PlacesController.prototype._shouldShowMenuItem should not depend on bug 232598. r=sdwilsh
browser/components/places/content/controller.js
--- a/browser/components/places/content/controller.js
+++ b/browser/components/places/content/controller.js
@@ -541,21 +541,24 @@ PlacesController.prototype = {
    */
   _shouldShowMenuItem: function PC__shouldShowMenuItem(aMenuItem, aMetaData) {
     var selectiontype = aMenuItem.getAttribute("selectiontype");
     if (selectiontype == "multiple" && aMetaData.length == 1)
       return false;
     if (selectiontype == "single" && aMetaData.length != 1)
       return false;
 
-    var forceHideRules = aMenuItem.getAttribute("forcehideselection").split("|");
-    for (var i = 0; i < aMetaData.length; ++i) {
-      for (var j=0; j < forceHideRules.length; ++j) {
-        if (forceHideRules[j] in aMetaData[i])
-          return false;
+    var forceHideAttr = aMenuItem.getAttribute("forcehideselection");
+    if (forceHideAttr) {
+      var forceHideRules = forceHideAttr.split("|");
+      for (var i = 0; i < aMetaData.length; ++i) {
+        for (var j=0; j < forceHideRules.length; ++j) {
+          if (forceHideRules[j] in aMetaData[i])
+            return false;
+        }
       }
     }
 
     var selectionAttr = aMenuItem.getAttribute("selection");
     if (selectionAttr) {
       if (selectionAttr == "any")
         return true;