Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7871)

Unified Diff: chrome/browser/resources/bookmark_manager/js/main.js

Issue 1059413005: Checking node object before checking its property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/bookmark_manager/js/main.js
diff --git a/chrome/browser/resources/bookmark_manager/js/main.js b/chrome/browser/resources/bookmark_manager/js/main.js
index dea7bfb756b36c3eb7a04defe9005caaf307d9b3..31f01af494e68d009f9dd9bb76d8319fd50c167c 100644
--- a/chrome/browser/resources/bookmark_manager/js/main.js
+++ b/chrome/browser/resources/bookmark_manager/js/main.js
@@ -318,7 +318,7 @@ function getAllUrls(nodes) {
// Adds the node and all its direct children.
function addNodes(node) {
- if (node.id == 'new')
+ if (!node || node.id == 'new')
return;
if (node.children) {
@@ -332,6 +332,10 @@ function getAllUrls(nodes) {
}
// Get a future promise for the nodes.
+ // TODO(deepak.m1): All the nodes here should be existed. When we delete
Bernhard Bauer 2015/04/30 15:08:07 Move this up to addNodes(), because that's where t
Deepak 2015/04/30 16:11:19 Done.
+ // the nodes then datamodel gets updated but still it shows deleted items as
+ // selected items and accessing those nodes throws chrome.runtime.lastError.
+ // Please refer https://crbug.com/480935.
var promises = nodes.map(function(node) {
if (bmm.isFolder(assert(node)))
return bmm.loadSubtree(node.id);

Powered by Google App Engine
This is Rietveld 408576698