From fd8ddae87e12ee60c02e1e15baabb68738ebbb7a Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Thu, 15 Jan 2004 02:57:15 +0000 Subject: [PATCH] Bug 228432 Warning ``reference to undefined property selection.item[0]'' [xs] in file ``chrome://communicator/content/bookmarks/bookmarksTree.xml'', line 641, character 0. r=neil sr=bz git-svn-id: svn://10.0.0.236/trunk@151350 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xpfe/components/bookmarks/resources/bookmarksTree.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mozilla/xpfe/components/bookmarks/resources/bookmarksTree.xml b/mozilla/xpfe/components/bookmarks/resources/bookmarksTree.xml index 0922e24b769..ccd0acb922e 100644 --- a/mozilla/xpfe/components/bookmarks/resources/bookmarksTree.xml +++ b/mozilla/xpfe/components/bookmarks/resources/bookmarksTree.xml @@ -638,11 +638,14 @@ { var selection = this.mOuter.getTreeSelection(); this.mOuter._selection = selection; - this.mOuter._target = this.mOuter.getTreeTarget(selection.item[0], selection.parent[0], BookmarksUtils.DROP_BEFORE); + var selectionLength = selection.length; + this.mOuter._target = selectionLength + ? this.mOuter.getTreeTarget(selection.item[0], selection.parent[0], BookmarksUtils.DROP_BEFORE) + : null; this.mOuter.onCommandUpdate(); const kStatusBar = document.getAnonymousElementByAttribute(this.mOuter, "anonid", "statusbar-text"); var displayValue; - if (kStatusBar && selection.length == 1) { + if (kStatusBar && selectionLength == 1) { var protocol = selection.protocol[0]; if (selection.isContainer[0] && protocol != "find" && protocol != "file") { RDFC.Init(this.mOuter.db, selection.item[0]);