| Index: chrome/browser/resources/md_bookmarks/actions.js
|
| diff --git a/chrome/browser/resources/md_bookmarks/actions.js b/chrome/browser/resources/md_bookmarks/actions.js
|
| index 11fd96e8c937921524ef2e88b5503962bd197b57..9f7800a123e1e77cc0ea7ac6664884858cda2030 100644
|
| --- a/chrome/browser/resources/md_bookmarks/actions.js
|
| +++ b/chrome/browser/resources/md_bookmarks/actions.js
|
| @@ -97,10 +97,15 @@ cr.define('bookmarks.actions', function() {
|
|
|
| /**
|
| * @param {string} id
|
| - * @return {!Action}
|
| + * @param {NodeMap} nodes Current node state. Can be ommitted in tests.
|
| + * @return {?Action}
|
| */
|
| - function selectFolder(id) {
|
| - assert(id != '0', 'Cannot select root folder');
|
| + function selectFolder(id, nodes) {
|
| + if (nodes && (id == ROOT_NODE_ID || !nodes[id] || nodes[id].url)) {
|
| + console.warn('Tried to select invalid folder: ' + id);
|
| + return null;
|
| + }
|
| +
|
| return {
|
| name: 'select-folder',
|
| id: id,
|
|
|