LibWeb/HTML: Check if evaluationStatus has a value before dereferencing
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, 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
Push notes / build (push) Waiting to run

Previously, we would crash if scripting was disabled and a javascript
URL was evaluated.
This commit is contained in:
rmg-x 2024-10-19 15:41:29 -05:00 committed by Tim Flynn
parent feaf2feab8
commit 57f82c029c
Notes: github-actions[bot] 2024-10-19 22:29:10 +00:00

View file

@ -1603,7 +1603,7 @@ WebIDL::ExceptionOr<JS::GCPtr<DOM::Document>> Navigable::evaluate_javascript_url
String result;
// 9. If evaluationStatus is a normal completion, and evaluationStatus.[[Value]] is a String, then set result to evaluationStatus.[[Value]].
if (evaluation_status.type() == JS::Completion::Type::Normal && evaluation_status.value()->is_string()) {
if (evaluation_status.type() == JS::Completion::Type::Normal && evaluation_status.value().has_value() && evaluation_status.value()->is_string()) {
result = evaluation_status.value()->as_string().utf8_string();
} else {
// 10. Otherwise, return null.