diff --git a/mailnews/local/src/nsLocalMailFolder.cpp b/mailnews/local/src/nsLocalMailFolder.cpp index 8ac567ecb4bd..a5223e6e4df3 100644 --- a/mailnews/local/src/nsLocalMailFolder.cpp +++ b/mailnews/local/src/nsLocalMailFolder.cpp @@ -1879,6 +1879,11 @@ nsMsgLocalMailFolder::CopyMessages(nsIMsgFolder* srcFolder, nsISupportsArray* { mCopyState->m_copyingMultipleMessages = PR_TRUE; rv = CopyMessagesTo(mCopyState->m_messages, msgWindow, this, isMove); + if (NS_FAILED(rv)) + { + NS_ERROR("copy message failed"); + (void) OnCopyCompleted(srcSupport, PR_FALSE); + } } else { @@ -2790,7 +2795,7 @@ nsresult nsMsgLocalMailFolder::CopyMessagesTo(nsISupportsArray *messages, nsresult rv; - nsCOMPtr copyStreamListener = do_CreateInstance(NS_COPYMESSAGESTREAMLISTENER_CONTRACTID); + nsCOMPtr copyStreamListener = do_CreateInstance(NS_COPYMESSAGESTREAMLISTENER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv,rv); nsCOMPtr copyListener(do_QueryInterface(dstFolder)); @@ -2873,7 +2878,7 @@ nsresult nsMsgLocalMailFolder::CopyMessageTo(nsISupports *message, nsXPIDLCString uri; srcFolder->GetUriForMsg(msgHdr, getter_Copies(uri)); - nsCOMPtr copyStreamListener = do_CreateInstance(NS_COPYMESSAGESTREAMLISTENER_CONTRACTID); + nsCOMPtr copyStreamListener = do_CreateInstance(NS_COPYMESSAGESTREAMLISTENER_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv,rv); nsCOMPtr copyListener(do_QueryInterface(dstFolder));