Bug 594239 - Follow-up: Don't pass null to nsDependentCString. r+a=me
authorJorg K <jorgk@jorgk.com>
Mon, 21 Jan 2019 00:32:16 +0100
changeset 33956 f978492d2a2e85bec7383b55228dd67ac22eca9a
parent 33955 c6a688894f61e63f9556cad0870372d469611d60
child 33957 108b096028369815e4b847f4ec88ead5664d69b9
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
bugs594239
Bug 594239 - Follow-up: Don't pass null to nsDependentCString. r+a=me
mailnews/mapi/mapihook/src/msgMapiImp.cpp
--- 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 :