add:      if (gBookmarksTree.currentIndex == -1) return;  
context: function selectTreeFolder(){  var resource = gBookmarksTree.currentResource;  if (resource == gSelectedFolder)    return;  gSelectedFolder = resource;  var menuitem = document.getElementById(gSelectedFolder.Value);  gMenulist.selectedItem = menuitem;  if (!menuitem) {    gMenulist.removeItemAt(gMenulist.firstChild.childNodes.length-1);    var newItem = gMenulist.appendItem(BookmarksUtils.getProperty(gSelectedFolder, gNC_NS+"Name"), gSelectedFolder.Value);    newItem.setAttribute("class", "menuitem-iconic folder-icon");    newItem.setAttribute("id", gSelectedFolder.Value);    gMenulist.selectedItem = newItem;  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/370cb7d8ca52e8f3cbd35a8fe93acce8d82dda08/addBookmark2.js/buggy/browser/components/bookmarks/content/addBookmark2.js