Bug 594239 - Follow-up: Don't pass null to nsDependentCString. r=me DONTBUILD
--- a/mailnews/mapi/mapihook/src/msgMapiImp.cpp
+++ b/mailnews/mapi/mapihook/src/msgMapiImp.cpp
@@ -166,20 +166,21 @@ STDMETHODIMP CMapiImp::Login(unsigned lo
}
// finally register(create) the session.
uint32_t nSession_Id;
int16_t nResult = 0;
nsMAPIConfiguration *pConfig = nsMAPIConfiguration::GetMAPIConfiguration();
if (pConfig != nullptr)
- nResult = pConfig->RegisterSession(aUIArg, nsDependentCString(aLogin),
- nsDependentCString(aPassWord),
- (aFlags & MAPI_FORCE_DOWNLOAD), bNewSession,
- &nSession_Id, id_key.get());
+ nResult = pConfig->RegisterSession(aUIArg,
+ aLogin ? nsDependentCString(aLogin) : EmptyCString(),
+ aPassWord ? nsDependentCString(aPassWord) : EmptyCString(),
+ (aFlags & MAPI_FORCE_DOWNLOAD), bNewSession,
+ &nSession_Id, id_key.get());
switch (nResult)
{
case -1 :
{
*aSessionId = MAPI_E_TOO_MANY_SESSIONS;
return hr;
}
case 0 :