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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js

Issue 2434853003: DevTools: [Sources] sourcesNavigator should not rely on existance of main target (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
index b80abb420e442970e64a9e32c0622547a65809cb..127f7104c0ddeb6ce2d5845ef6b8f469463dbfd7 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesNavigator.js
@@ -59,7 +59,7 @@ WebInspector.SourcesNavigatorView.prototype = {
return;
var inspectedURL = mainTarget && mainTarget.inspectedURL();
if (!inspectedURL)
- return
+ return;
for (var node of this._uiSourceCodeNodes.valuesArray()) {
var uiSourceCode = node.uiSourceCode();
if (uiSourceCode.url() === inspectedURL)
@@ -73,8 +73,11 @@ WebInspector.SourcesNavigatorView.prototype = {
*/
uiSourceCodeAdded: function(uiSourceCode)
{
- var inspectedPageURL = WebInspector.targetManager.mainTarget().inspectedURL();
- if (uiSourceCode.url() === inspectedPageURL)
+ var mainTarget = WebInspector.targetManager.mainTarget();
+ var inspectedURL = mainTarget && mainTarget.inspectedURL();
+ if (!inspectedURL)
+ return;
+ if (uiSourceCode.url() === inspectedURL)
this.revealUISourceCode(uiSourceCode, true);
},
@@ -137,8 +140,11 @@ WebInspector.NetworkNavigatorView.prototype = {
*/
uiSourceCodeAdded: function(uiSourceCode)
{
- var inspectedPageURL = WebInspector.targetManager.mainTarget().inspectedURL();
- if (uiSourceCode.url() === inspectedPageURL)
+ var mainTarget = WebInspector.targetManager.mainTarget();
+ var inspectedURL = mainTarget && mainTarget.inspectedURL();
+ if (!inspectedURL)
+ return;
+ if (uiSourceCode.url() === inspectedURL)
this.revealUISourceCode(uiSourceCode, true);
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698