mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibJS: Don't assume call_frame->current_node in Exception constructor
It's a nullptr in promise reaction job functions, for example. Regressed
in 97d49cb
.
Fixes #6641.
This commit is contained in:
parent
dbe72fd962
commit
af62678c31
Notes:
sideshowbarker
2024-07-18 19:05:27 +09:00
1 changed files with 5 additions and 1 deletions
|
@ -24,7 +24,11 @@ Exception::Exception(Value value)
|
|||
function_name = "<anonymous>";
|
||||
m_traceback.prepend({
|
||||
.function_name = move(function_name),
|
||||
.source_range = call_frame->current_node->source_range(),
|
||||
// We might not have an AST node associated with the call frame, e.g. in promise
|
||||
// reaction jobs (which aren't called anywhere from the source code).
|
||||
// They're not going to generate any _unhandled_ exceptions though, so a meaningless
|
||||
// source range is fine.
|
||||
.source_range = call_frame->current_node ? call_frame->current_node->source_range() : SourceRange {},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue