Bug 1194153 - Chrome Registry's convertChromeURL shouldn't crash when given a null url, r=bsmedberg.
authorFlorian Quèze <florian@queze.net>
Fri, 04 Sep 2015 11:39:08 +0200
changeset 260857 6bde454912d5ed04e9d52b6209d3e91959f5a770
parent 260856 3a6613c338c266d7d18837a8eb6b1b7f5c037708
child 260858 925475a10f088b50543a2a169bea2ca4d0a95257
push id29328
push userkwierso@gmail.com
push dateFri, 04 Sep 2015 22:13:38 +0000
treeherdermozilla-central@d41fa6f2f1da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1194153
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1194153 - Chrome Registry's convertChromeURL shouldn't crash when given a null url, r=bsmedberg.
chrome/nsChromeRegistry.cpp
--- a/chrome/nsChromeRegistry.cpp
+++ b/chrome/nsChromeRegistry.cpp
@@ -260,17 +260,19 @@ nsChromeRegistry::Canonify(nsIURL* aChro
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURI, nsIURI* *aResult)
 {
   nsresult rv;
-  NS_ASSERTION(aChromeURI, "null url!");
+  if (NS_WARN_IF(!aChromeURI)) {
+    return NS_ERROR_INVALID_ARG;
+  }
 
   if (mOverrideTable.Get(aChromeURI, aResult))
     return NS_OK;
 
   nsCOMPtr<nsIURL> chromeURL (do_QueryInterface(aChromeURI));
   NS_ENSURE_TRUE(chromeURL, NS_NOINTERFACE);
 
   nsAutoCString package, provider, path;