107311 - add null check

r=jst, sr=sspitzer


git-svn-id: svn://10.0.0.236/trunk@106656 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ben%netscape.com
2001-10-30 06:42:41 +00:00
parent 3b6e234339
commit c35f184eac

View File

@@ -520,7 +520,8 @@ nsContextMenu.prototype = {
// Show/hide one item (specified via name or the item element itself).
showItem : function ( itemOrId, show ) {
var item = itemOrId.constructor == String ? document.getElementById(itemOrId) : itemOrId;
item.hidden = !show;
if (item)
item.hidden = !show;
},
// Set given attribute of specified context-menu item. If the
// value is null, then it removes the attribute (which works