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 33400 0befd65ff82b
parent 33399 ff32d5c4c737
child 33401 bf2126d1ba5c
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 :