mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:38:11 +00:00
LibWeb: Show error page if we can't handle a frame's main resource
If we can't figure out how to make a Document for the main resource in a Frame, just show an error page.
This commit is contained in:
parent
f88146c7c9
commit
71da52482c
1 changed files with 6 additions and 1 deletions
|
@ -221,7 +221,12 @@ void FrameLoader::resource_did_load()
|
|||
|
||||
dbg() << "I believe this content has MIME type '" << resource()->mime_type() << "', encoding '" << resource()->encoding() << "'";
|
||||
auto document = create_document_from_mime_type(resource()->encoded_data(), url, resource()->mime_type(), resource()->encoding());
|
||||
ASSERT(document);
|
||||
|
||||
if (!document) {
|
||||
load_error_page(url, "Failed to parse content.");
|
||||
return;
|
||||
}
|
||||
|
||||
frame().set_document(document);
|
||||
|
||||
if (!url.fragment().is_empty())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue