diff --git a/dom/src/jsurl/nsJSProtocolHandler.cpp b/dom/src/jsurl/nsJSProtocolHandler.cpp index 2410feeea06d..6b238fe3cd0e 100644 --- a/dom/src/jsurl/nsJSProtocolHandler.cpp +++ b/dom/src/jsurl/nsJSProtocolHandler.cpp @@ -251,6 +251,10 @@ nsresult nsJSThunk::EvaluateScript(nsIChannel *aChannel) if (principal) { nsCOMPtr uri; rv = principal->GetURI(getter_AddRefs(uri)); + if (!uri) { + rv = NS_ERROR_NOT_AVAILABLE; + } + if (NS_SUCCEEDED(rv)) { nsCAutoString spec; uri->GetSpec(spec);