bug 356017: make sure folder item is selected before retrieving selected resource in bookmarks tree to avoid exception which prevents the Add Bookmarks dialog from properly creating the bookmark and closing when the user presses the Add button

r=gavin


git-svn-id: svn://10.0.0.236/trunk@213850 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
myk%mozilla.org
2006-10-19 18:17:31 +00:00
parent 1d82c0de59
commit 095b04ff89

View File

@@ -303,6 +303,14 @@ function selectMenulistFolder(aEvent)
function selectTreeFolder()
{
// If no item is selected, we obviously can't do anything with the selection.
// This happens when the bookmarks tree rebuilds, since the rebuild starts
// by removing all items from the tree, including the currently selected item,
// and removing the selection also triggers the "select" handler which calls
// this function.
if (gBookmarksTree.currentIndex == -1)
return;
var resource = gBookmarksTree.currentResource;
if (resource == gSelectedFolder)
return;