Skip to content

Instantly share code, notes, and snippets.

@indutny indutny/patch.diff Secret
Created Apr 30, 2012

Embed
What would you like to do?
diff --git a/src/node_script.cc b/src/node_script.cc
index 0375fa4..988b41b 100644
--- a/src/node_script.cc
+++ b/src/node_script.cc
@@ -256,8 +256,8 @@ Handle<Value> WrappedScript::CreateContext(const Arguments& args) {
Local<Object> context = WrappedContext::NewInstance();
- if (args.Length() > 0) {
- Local<Object> sandbox = args[0]->ToObject();
+ if (args.Length() > 0 && args[0]->IsObject()) {
+ Local<Object> sandbox = args[0].As<Object>();
CloneObject(args.This(), sandbox, context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.