Fix crash when releasing a script context that never had node injected (#12741)

This commit is contained in:
Jeremy Apthorp 2018-05-01 17:00:46 -07:00 committed by Shelley Vohr
parent d355bf0267
commit 78ab97ab04

View file

@ -122,6 +122,8 @@ void AtomRendererClient::DidCreateScriptContext(
void AtomRendererClient::WillReleaseScriptContext( void AtomRendererClient::WillReleaseScriptContext(
v8::Handle<v8::Context> context, v8::Handle<v8::Context> context,
content::RenderFrame* render_frame) { content::RenderFrame* render_frame) {
if (injected_frames_.find(render_frame) == injected_frames_.end())
return;
injected_frames_.erase(render_frame); injected_frames_.erase(render_frame);
node::Environment* env = node::Environment::GetCurrent(context); node::Environment* env = node::Environment::GetCurrent(context);