diff --git a/mozilla/content/base/src/nsDocumentViewer.cpp b/mozilla/content/base/src/nsDocumentViewer.cpp index d88dea41752..1685e1f792b 100644 --- a/mozilla/content/base/src/nsDocumentViewer.cpp +++ b/mozilla/content/base/src/nsDocumentViewer.cpp @@ -1049,8 +1049,10 @@ DocumentViewerImpl::Init(nsIWidget* aParentWidget, { // get the DOM event receiver nsCOMPtr erP (do_QueryInterface(mDocument, &rv)); - if(NS_FAILED(rv) || !erP) - return rv?rv:NS_ERROR_FAILURE; + if(NS_FAILED(rv)) + return rv; + if(!erP) + return NS_ERROR_FAILURE; rv = erP->AddEventListenerByIID(mFocusListener, NS_GET_IID(nsIDOMFocusListener)); NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register focus listener"); diff --git a/mozilla/content/base/src/nsSelection.cpp b/mozilla/content/base/src/nsSelection.cpp index d95ae2a8a2a..7b624a24db2 100644 --- a/mozilla/content/base/src/nsSelection.cpp +++ b/mozilla/content/base/src/nsSelection.cpp @@ -3007,8 +3007,10 @@ NS_IMETHODIMP nsSelection::SelectAll() nsCOMPtr doc; rv = shell->GetDocument(getter_AddRefs(doc)); - if (NS_FAILED(rv) || !doc) - return rv?rv:NS_ERROR_FAILURE; + if (NS_FAILED(rv)) + return rv; + if (!doc) + return NS_ERROR_FAILURE; doc->GetRootContent(getter_AddRefs(rootContent)); if (!rootContent) return NS_ERROR_FAILURE; diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index d88dea41752..1685e1f792b 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -1049,8 +1049,10 @@ DocumentViewerImpl::Init(nsIWidget* aParentWidget, { // get the DOM event receiver nsCOMPtr erP (do_QueryInterface(mDocument, &rv)); - if(NS_FAILED(rv) || !erP) - return rv?rv:NS_ERROR_FAILURE; + if(NS_FAILED(rv)) + return rv; + if(!erP) + return NS_ERROR_FAILURE; rv = erP->AddEventListenerByIID(mFocusListener, NS_GET_IID(nsIDOMFocusListener)); NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register focus listener"); diff --git a/mozilla/layout/generic/nsSelection.cpp b/mozilla/layout/generic/nsSelection.cpp index d95ae2a8a2a..7b624a24db2 100644 --- a/mozilla/layout/generic/nsSelection.cpp +++ b/mozilla/layout/generic/nsSelection.cpp @@ -3007,8 +3007,10 @@ NS_IMETHODIMP nsSelection::SelectAll() nsCOMPtr doc; rv = shell->GetDocument(getter_AddRefs(doc)); - if (NS_FAILED(rv) || !doc) - return rv?rv:NS_ERROR_FAILURE; + if (NS_FAILED(rv)) + return rv; + if (!doc) + return NS_ERROR_FAILURE; doc->GetRootContent(getter_AddRefs(rootContent)); if (!rootContent) return NS_ERROR_FAILURE;