LibWeb/ServiceWorker: Use has_value for checking for invalid URL

This is the correct API to call here.
This commit is contained in:
Shannon Booth 2025-02-16 14:05:25 +13:00 committed by Tim Flynn
parent c86b5068d0
commit dc2b0e17bf
Notes: github-actions[bot] 2025-02-19 13:03:18 +00:00

View file

@ -179,7 +179,7 @@ void ServiceWorkerContainer::start_register(Optional<URL::URL> scope_url, Option
}
// 6. If scopeURL is failure, reject promise with a TypeError and abort these steps.
if (!scope_url->is_valid()) {
if (!scope_url.has_value()) {
WebIDL::reject_promise(realm, promise, JS::TypeError::create(realm, "scopeURL is not a valid URL"sv));
return;
}