File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -15,16 +15,15 @@ node::Environment* AtomIsolatedWorld::env_ = nullptr;
1515AtomIsolatedWorld::AtomIsolatedWorld (NodeBindings* node_bindings) :
1616 v8::Extension (" AtomIsolatedWorld" , " native function SetupNode();" ) {
1717 node_bindings_ = node_bindings;
18- env_ = nullptr ;
1918}
2019
2120AtomIsolatedWorld::~AtomIsolatedWorld () {
2221 node_bindings_ = nullptr ;
23- env_ = nullptr ;
2422}
2523
2624node::Environment* AtomIsolatedWorld::CreateEnvironment (
2725 content::RenderFrame* frame) {
26+ env_ = nullptr ;
2827 blink::WebScriptSource source (" SetupNode()" );
2928 frame->GetWebFrame ()->executeScriptInIsolatedWorld (
3029 1 ,
@@ -46,8 +45,9 @@ v8::Local<v8::FunctionTemplate> AtomIsolatedWorld::GetNativeFunctionTemplate(
4645// static
4746void AtomIsolatedWorld::SetupNode (
4847 const v8::FunctionCallbackInfo<v8::Value>& args) {
49- env_ = node_bindings_->CreateEnvironment (
50- args.GetIsolate ()->GetCurrentContext ());
48+ if (node_bindings_ != nullptr )
49+ env_ = node_bindings_->CreateEnvironment (
50+ args.GetIsolate ()->GetCurrentContext ());
5151}
5252
5353// static
You can’t perform that action at this time.
0 commit comments