mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
WebContent: Do not crash on dumping unavailable localStorage
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Be a bit more defensive about this so we don't crash when trying to dump unavailable local storage, such as on about:newtab.
This commit is contained in:
parent
0ff61e5e7b
commit
d1abd11b78
Notes:
github-actions[bot]
2025-07-17 22:41:24 +00:00
Author: https://github.com/gmta
Commit: d1abd11b78
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5496
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 8 additions and 2 deletions
|
@ -251,6 +251,7 @@ void ConnectionFromClient::debug_request(u64 page_id, ByteString request, ByteSt
|
|||
if (request == "dump-session-history") {
|
||||
auto const& traversable = page->page().top_level_traversable();
|
||||
Web::dump_tree(*traversable);
|
||||
return;
|
||||
}
|
||||
|
||||
if (request == "dump-display-list") {
|
||||
|
@ -393,8 +394,13 @@ void ConnectionFromClient::debug_request(u64 page_id, ByteString request, ByteSt
|
|||
}
|
||||
|
||||
if (request == "dump-local-storage") {
|
||||
if (auto* document = page->page().top_level_browsing_context().active_document())
|
||||
document->window()->local_storage().release_value_but_fixme_should_propagate_errors()->dump();
|
||||
if (auto* document = page->page().top_level_browsing_context().active_document()) {
|
||||
auto storage_or_error = document->window()->local_storage();
|
||||
if (storage_or_error.is_error())
|
||||
dbgln("Failed to retrieve local storage: {}", storage_or_error.release_error());
|
||||
else
|
||||
storage_or_error.release_value()->dump();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue