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

Unified Diff: devtools.js

Issue 29491555: Noissue - Check if ExtensionPanel has onSearch before adding listener (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created July 18, 2017, 5:28 a.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: devtools.js
===================================================================
--- a/devtools.js
+++ b/devtools.js
@@ -39,18 +39,21 @@
panelWindow = window;
});
panel.onHidden.addListener(window =>
{
panelWindow = null;
});
- panel.onSearch.addListener((eventName, queryString) =>
+ if (panel.onSearch)
{
- if (panelWindow)
- panelWindow.postMessage({type: eventName, queryString}, "*");
- });
+ panel.onSearch.addListener((eventName, queryString) =>
+ {
+ if (panelWindow)
+ panelWindow.postMessage({type: eventName, queryString}, "*");
+ });
+ }
}
);
}
}
);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld