diff options
author | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-04 16:54:42 +0000 |
---|---|---|
committer | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-04 16:54:42 +0000 |
commit | 0ade9bae36ea0e55df258e3a2db2febbbb7acc1d (patch) | |
tree | 662391e7b14446b88f7bfc1da165427c28c40c18 /chrome/browser/resources | |
parent | d1c886897fbe3e7f6745c4046c0f40df6b444fa9 (diff) | |
download | chromium_src-0ade9bae36ea0e55df258e3a2db2febbbb7acc1d.zip chromium_src-0ade9bae36ea0e55df258e3a2db2febbbb7acc1d.tar.gz chromium_src-0ade9bae36ea0e55df258e3a2db2febbbb7acc1d.tar.bz2 |
Bookmarks: Fix a script error when deleting multiple folders.
When deleting multiple folders we get callback after each remove and this can trigger a selection change which in turn triggers a call to getSubtree for a folder that was just removed. When this happens we finish the Promise with the value undefined.
BUG=None
TEST=Create two folders and select both. Hit Delete and check that we do not get a script error. (We still get an error from the extension API that the id no longer exists but at least we do not keel over.
Review URL: http://codereview.chromium.org/2647001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48938 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r-- | chrome/browser/resources/bookmark_manager/js/bmm.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/chrome/browser/resources/bookmark_manager/js/bmm.js b/chrome/browser/resources/bookmark_manager/js/bmm.js index b02d850..f3d824aa 100644 --- a/chrome/browser/resources/bookmark_manager/js/bmm.js +++ b/chrome/browser/resources/bookmark_manager/js/bmm.js @@ -3,7 +3,6 @@ // found in the LICENSE file. cr.define('bmm', function() { - const TreeIterator = bmm.TreeIterator; const Promise = cr.Promise; /** @@ -44,7 +43,7 @@ cr.define('bmm', function() { loadingPromises[id] = new Promise; chrome.experimental.bookmarkManager.getSubtree(id, false, function(nodes) { - loadingPromises[id].value = nodes[0]; + loadingPromises[id].value = nodes && nodes[0]; delete loadingPromises[id]; }); } |