LibWeb: Catch null browsing context in destroy_top_level_traversable

When WebDriver asks to destroy a window, we can hit this case with no
active browsing context. This seems odd, but perhaps is a spec issue as
well. Just log to dbgln for now.
This commit is contained in:
Andrew Kaster 2024-02-05 03:26:05 -07:00 committed by Andrew Kaster
parent d508a02f25
commit 813c66403d
Notes: sideshowbarker 2024-07-17 22:01:16 +09:00

View file

@ -888,7 +888,11 @@ void TraversableNavigable::destroy_top_level_traversable()
}
// 3. Remove browsingContext.
browsing_context->remove();
if (!browsing_context) {
dbgln("TraversableNavigable::destroy_top_level_traversable: No browsing context?");
} else {
browsing_context->remove();
}
// 4. Remove traversable from the user interface (e.g., close or hide its tab in a tabbed browser).
page().client().page_did_close_top_level_traversable();