Skip to content

Commit 7173d32

Browse files
committed
Merge Crash fix when formatting a stack trace from a callback that's inside an eval() function in JS (pr-3406)
67b9ac1 - fix(citizen-scripting-v8): Crash when formatting a stack trace from a callback that's inside an eval() function.
2 parents cf0133b + 67b9ac1 commit 7173d32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

code/components/citizen-scripting-v8/src/V8ScriptRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2299,7 +2299,7 @@ static void OnMessage(Local<Message> message, Local<Value> error)
22992299
v8::String::Utf8Value sourceStr(GetV8Isolate(), frame->GetScriptNameOrSourceURL());
23002300
v8::String::Utf8Value functionStr(GetV8Isolate(), frame->GetFunctionName());
23012301

2302-
stack << *sourceStr << "(" << frame->GetLineNumber() << "," << frame->GetColumn() << "): " << (*functionStr ? *functionStr : "") << "\n";
2302+
stack << (*sourceStr ? *sourceStr : "(unknown)") << "(" << frame->GetLineNumber() << "," << frame->GetColumn() << "): " << (*functionStr ? *functionStr : "") << "\n";
23032303
}
23042304

23052305
ScriptTrace("%s\n%s\n%s\n", *messageStr, stack.str(), *errorStr);

0 commit comments

Comments
 (0)