Bug 594239 - Follow-up: Don't pass null to nsDependentCString. r=me DONTBUILD
authorJorg K <jorgk@jorgk.com>
Mon, 21 Jan 2019 00:32:16 +0100
changeset 34254 0befd65ff82b2f4309a3e6ebdc4a900ea6717c07
parent 34253 ff32d5c4c737b02ed4c19364920e8d0404405c68
child 34255 bf2126d1ba5c199f4f3c92baac8bd519bd828905
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersme
bugs594239
Bug 594239 - Follow-up: Don't pass null to nsDependentCString. r=me DONTBUILD
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 :