Bug 1278452 - Remove an unnecessary null check in js/src/shell/. r=mrbkap.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 07 Jun 2016 14:36:59 +1000
changeset 301022 4b3df77d399ad1be7c9df0987a0e1f0c9226a2d4
parent 301021 9d63042e0d38c658599b0770aa6f821ef8d59ad8
child 301023 dd5cfca074c36cdb5aa323ff53b03539650bec1f
push id19599
push usercbook@mozilla.com
push dateWed, 08 Jun 2016 10:16:21 +0000
treeherderfx-team@81f4cc3f6f4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1278452
milestone50.0a1
Bug 1278452 - Remove an unnecessary null check in js/src/shell/. r=mrbkap. The check is unnecessary because |operator new| is infallible.
js/xpconnect/src/nsXPConnect.cpp
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -268,17 +268,17 @@ xpc::ErrorReport::LogToConsoleWithStack(
       // As we cache messages in the console service,
       // we have to ensure not leaking them after the related
       // context is destroyed and we only track document lifecycle for now.
       errorObject = new nsScriptErrorWithStack(aStack);
     } else {
       errorObject = new nsScriptError();
     }
     errorObject->SetErrorMessageName(mErrorMsgName);
-    NS_ENSURE_TRUE_VOID(consoleService && errorObject);
+    NS_ENSURE_TRUE_VOID(consoleService);
 
     nsresult rv = errorObject->InitWithWindowID(mErrorMsg, mFileName, mSourceLine,
                                                 mLineNumber, mColumn, mFlags,
                                                 mCategory, mWindowID);
     NS_ENSURE_SUCCESS_VOID(rv);
     consoleService->LogMessage(errorObject);
 
 }