diff --git a/AK/URLParser.cpp b/AK/URLParser.cpp index 6b3c4cdc7c..6707593091 100644 --- a/AK/URLParser.cpp +++ b/AK/URLParser.cpp @@ -632,7 +632,9 @@ ErrorOr URLParser::serialize_host(URL::Host const& host) } // 3. Otherwise, host is a domain, opaque host, or empty host, return host. - return host.get(); + if (host.has()) + return host.get(); + return String {}; } // https://url.spec.whatwg.org/#start-with-a-windows-drive-letter