diff options
Diffstat (limited to 'embed/mozilla/EphySingle.cpp')
-rw-r--r-- | embed/mozilla/EphySingle.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/embed/mozilla/EphySingle.cpp b/embed/mozilla/EphySingle.cpp index ec8eb0b84..d3a78bca9 100644 --- a/embed/mozilla/EphySingle.cpp +++ b/embed/mozilla/EphySingle.cpp @@ -148,20 +148,20 @@ EphySingle::EmitPermissionNotification (const char *name, nsresult EphySingle::ExamineCookies (nsISupports *aSubject) { - nsCOMPtr<nsIPropertyBag2> props = do_QueryInterface(aSubject); - NS_ENSURE_TRUE (props, NS_ERROR_FAILURE); - PRBool isBlockingCookiesChannel = PR_FALSE; - props->GetPropertyAsBool( - NS_LITERAL_STRING("epiphany-blocking-cookies"), - &isBlockingCookiesChannel); - if (isBlockingCookiesChannel) + + nsCOMPtr<nsIPropertyBag2> props (do_QueryInterface(aSubject)); + if (props && + NS_SUCCEEDED (props->GetPropertyAsBool( + NS_LITERAL_STRING("epiphany-blocking-cookies"), + &isBlockingCookiesChannel)) && + isBlockingCookiesChannel) { - nsCOMPtr<nsIHttpChannel> channel = do_QueryInterface(aSubject); - NS_ENSURE_TRUE (channel, NS_ERROR_FAILURE); + nsCOMPtr<nsIHttpChannel> httpChannel (do_QueryInterface(aSubject)); - channel->SetRequestHeader(NS_LITERAL_CSTRING("Cookie"), - EmptyCString(), PR_FALSE); + if (httpChannel) + httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Cookie"), + EmptyCString(), PR_FALSE); } return NS_OK; |