Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/cssInjection.js

Issue 29696583: Issue 6385 - Don't attempt to inject styles for frames we can't find (Closed)
Patch Set: Return `false` explicitly instead of `undefined` implicitly Created Feb. 14, 2018, 2:49 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
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: lib/cssInjection.js
diff --git a/lib/cssInjection.js b/lib/cssInjection.js
index e5a918d54c1eef5e016a7fc80b729ce31328ebe3..30977ed1248e33c74a1ef20ed05693a02eb36eef 100644
--- a/lib/cssInjection.js
+++ b/lib/cssInjection.js
@@ -106,6 +106,9 @@ function updateFrameStyles(tabId, frameId, selectors, groupName)
styleSheet = createStyleSheet(selectors);
let frame = ext.getFrame(tabId, frameId);
+ if (!frame)
+ return false;
+
if (!frame.injectedStyleSheets)
frame.injectedStyleSheets = new Map();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld