summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
Diffstat (limited to 'dom')
-rw-r--r--dom/base/Location.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/dom/base/Location.cpp b/dom/base/Location.cpp
index e3b614931..b17e733d5 100644
--- a/dom/base/Location.cpp
+++ b/dom/base/Location.cpp
@@ -577,9 +577,10 @@ Location::GetPathname(nsAString& aPathname)
aPathname.Truncate();
nsCOMPtr<nsIURI> uri;
- nsresult result = NS_OK;
-
- result = GetURI(getter_AddRefs(uri));
+ nsresult result = GetURI(getter_AddRefs(uri));
+ if (NS_FAILED(result) || !uri) {
+ return result;
+ }
nsCOMPtr<nsIURIWithQuery> url(do_QueryInterface(uri));
if (url) {