Index: Source/core/html/HTMLAppletElement.cpp |
diff --git a/Source/core/html/HTMLAppletElement.cpp b/Source/core/html/HTMLAppletElement.cpp |
index 91b3cbb7d897d02c00ae4df2189ac6e4fe06c921..b62750492630ba84a99d18c31341ef6932ddaac0 100644 |
--- a/Source/core/html/HTMLAppletElement.cpp |
+++ b/Source/core/html/HTMLAppletElement.cpp |
@@ -151,7 +151,12 @@ void HTMLAppletElement::updateWidgetInternal() |
// attribute is set, then 'code' points to a class inside the archive, so we need to check the |
// url generated by resolving 'archive' against 'codebase'. |
KURL urlToCheck; |
- KURL rootURL = codeBase.isNull() ? document().url() : document().completeURL(codeBase); |
+ KURL rootURL; |
+ if (!codeBase.isNull()) |
+ rootURL = document().completeURL(codeBase); |
+ if (rootURL.isNull() || !rootURL.isValid()) |
+ rootURL = document().url(); |
+ |
if (!archive.isNull()) |
urlToCheck = KURL(rootURL, archive); |
else if (!code.isNull()) |