diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 6 |
2 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2003-12-04 Christian Persch <chpe@cvs.gnome.org> + + * embed/mozilla/EphyBrowser.cpp: + + Add some missing NULL checks. + 2003-12-03 Christian Persch <chpe@cvs.gnome.org> * lib/widgets/ephy-spinner.c: diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index 08b81190a..a105987b3 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -522,6 +522,7 @@ nsresult EphyBrowser::GetDocumentUrl (nsCString &url) nsCOMPtr<nsIURI> uri; doc->GetDocumentURL(getter_AddRefs(uri)); #endif + if (!uri) return NS_ERROR_FAILURE; return uri->GetSpec (url); } @@ -545,10 +546,9 @@ nsresult EphyBrowser::GetTargetDocumentUrl (nsCString &url) nsCOMPtr<nsIURI> uri; doc->GetDocumentURL(getter_AddRefs(uri)); #endif + if (!uri) return NS_ERROR_FAILURE; - uri->GetSpec (url); - - return NS_OK; + return uri->GetSpec (url); } nsresult EphyBrowser::ForceEncoding (const char *encoding) |