From 845924eac548e57f711c1f07259f299f15bf9f2c Mon Sep 17 00:00:00 2001 From: Eric Rahm Date: Thu, 23 Jul 2015 11:02:45 -0700 Subject: [PATCH] Bug 1184293 - Don't call ThirdPartyUtil::GetBaseDomain if aUri is null. r=jduell Return early if aUri is null so as to avoid warnings about it. --- dom/base/ThirdPartyUtil.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dom/base/ThirdPartyUtil.cpp b/dom/base/ThirdPartyUtil.cpp index f04b07d068c0..436abc00ae56 100644 --- a/dom/base/ThirdPartyUtil.cpp +++ b/dom/base/ThirdPartyUtil.cpp @@ -344,6 +344,10 @@ NS_IMETHODIMP ThirdPartyUtil::GetBaseDomain(nsIURI* aHostURI, nsACString& aBaseDomain) { + if (!aHostURI) { + return NS_ERROR_INVALID_ARG; + } + // Get the base domain. this will fail if the host contains a leading dot, // more than one trailing dot, or is otherwise malformed. nsresult rv = mTLDService->GetBaseDomain(aHostURI, 0, aBaseDomain);