mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWeb: Fix crash in XMLHttpRequest::response_xml() if response empty
If response object is empty we should return nullptr. Fixes crash on https://store.steampowered.com/
This commit is contained in:
parent
732b39d120
commit
09c1eccb50
Notes:
sideshowbarker
2024-07-16 20:08:14 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/09c1eccb50 Pull-request: https://github.com/SerenityOS/serenity/pull/21328
1 changed files with 2 additions and 0 deletions
|
@ -144,6 +144,8 @@ WebIDL::ExceptionOr<JS::GCPtr<DOM::Document>> XMLHttpRequest::response_xml()
|
|||
set_document_response();
|
||||
|
||||
// 6. Return this’s response object.
|
||||
if (m_response_object.has<Empty>())
|
||||
return nullptr;
|
||||
return &verify_cast<DOM::Document>(m_response_object.get<JS::Value>().as_object());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue