Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 04e317b5cfa6eeb9c3d55ba3525563b3547a51d4..38d108d785f3c43e4031a43d4b2aefadedccb2cf 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -98,7 +98,9 @@ namespace v8 { |
#define PREPARE_FOR_EXECUTION_GENERIC(context, function_name, bailout_value, \ |
HandleScopeClass) \ |
- auto isolate = reinterpret_cast<i::Isolate*>(context->GetIsolate()); \ |
+ auto isolate = context.IsEmpty() \ |
+ ? i::Isolate::Current() \ |
+ : reinterpret_cast<i::Isolate*>(context->GetIsolate()); \ |
if (IsExecutionTerminatingCheck(isolate)) { \ |
return bailout_value; \ |
} \ |