mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb: Avoid dereferencing an empty optional URL
Here, "null" means the empty optional. We don't need to also check if the URL is valid; the url will be null if it was originally invalid.
This commit is contained in:
Notes:
github-actions[bot]
2024-12-11 17:34:46 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/943ec820fc5 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2880 Reviewed-by: https://github.com/tcl3 ✅
8
Tests/LibWeb/Text/input/HTML/href-invalid.html
Normal file
8
Tests/LibWeb/Text/input/HTML/href-invalid.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const a = document.createElement("a");
|
||||
a.href = "http://foo:b/c";
|
||||
println(`href="${a.href}"`);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user