Index: third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js |
index 15e04152973af2ea073e2834b5c1e3359bdbc924..b771ffd8ecd29ffe6ed3ba1f52adad1a427697f1 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js |
+++ b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js |
@@ -96,9 +96,8 @@ WebInspector.ScriptSnippetModel.prototype = { |
_loadSnippets: function() |
{ |
- var snippets = this._snippetStorage.snippets(); |
- for (var i = 0; i < snippets.length; ++i) |
- this._addScriptSnippet(snippets[i]); |
+ for (var snippet of this._snippetStorage.snippets()) |
+ this._addScriptSnippet(snippet); |
}, |
/** |
@@ -146,6 +145,8 @@ WebInspector.ScriptSnippetModel.prototype = { |
return; |
var snippetId = this._snippetIdForUISourceCode.get(uiSourceCode) || ""; |
var snippet = this._snippetStorage.snippetForId(snippetId); |
+ if (!snippet) |
+ return; |
this._snippetStorage.deleteSnippet(snippet); |
this._removeBreakpoints(uiSourceCode); |
this._releaseSnippetScript(uiSourceCode); |