diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp
index 96a0fb3657a9..4d7ab22dcf74 100644
--- a/parser/html/nsHtml5TreeOpExecutor.cpp
+++ b/parser/html/nsHtml5TreeOpExecutor.cpp
@@ -861,6 +861,9 @@ nsHtml5TreeOpExecutor::InitializeDocWriteParserState(nsAHtml5TreeBuilderState* a
already_AddRefed
nsHtml5TreeOpExecutor::ConvertIfNotPreloadedYet(const nsAString& aURL)
{
+ if (aURL.IsEmpty()) {
+ return nsnull;
+ }
// The URL of the document without
nsIURI* documentURI = mDocument->GetDocumentURI();
// The URL of the document with non-speculative