Bug 1493934 - Don't Append(null) in nsMailboxUrl::GetNormalizedSpec(). rs=bustage-fix DONTBUILD
authorJorg K <jorgk@jorgk.com>
Tue, 25 Sep 2018 15:19:12 +0200
changeset 33225 f600e1fb24b3695e08aeee35363b91c344382f38
parent 33224 c695d2d8148c025254be5eab83310bf21490d418
child 33226 1b38cacc09e510c2e418a9af31bd3bcaf55404f2
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersbustage-fix
bugs1493934
Bug 1493934 - Don't Append(null) in nsMailboxUrl::GetNormalizedSpec(). rs=bustage-fix DONTBUILD
mailnews/local/src/nsMailboxUrl.cpp
--- a/mailnews/local/src/nsMailboxUrl.cpp
+++ b/mailnews/local/src/nsMailboxUrl.cpp
@@ -153,19 +153,21 @@ NS_IMETHODIMP nsMailboxUrl::GetNormalize
     if (NS_SUCCEEDED (rv)) {
       nsAutoCString buf;
       MsgEscapeURL(folderPath,
                    nsINetUtil::ESCAPE_URL_DIRECTORY | nsINetUtil::ESCAPE_URL_FORCED, buf);
       spec = NS_LITERAL_CSTRING("mailbox://") + buf;
     }
   }
 
-  spec += NS_LITERAL_CSTRING("?number=");
-  spec.Append(messageKey);
-  PR_Free(messageKey);
+  if (messageKey) {
+    spec += NS_LITERAL_CSTRING("?number=");
+    spec.Append(messageKey);
+    PR_Free(messageKey);
+  }
 
   aPrincipalSpec.Assign(spec);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMailboxUrl::SetUri(const char * aURI)
 {
   mURI= aURI;