diff --git a/mailnews/base/util/nsMsgDBFolder.cpp b/mailnews/base/util/nsMsgDBFolder.cpp index ba7e70b1966..4af17b00946 100644 --- a/mailnews/base/util/nsMsgDBFolder.cpp +++ b/mailnews/base/util/nsMsgDBFolder.cpp @@ -259,7 +259,7 @@ NS_IMETHODIMP nsMsgDBFolder::OnKeyDeleted(nsMsgKey aKeyChanged, PRInt32 aFlags, { nsCOMPtr pMsgDBHdr; nsresult rv = mDatabase->GetMsgHdrForKey(aKeyChanged, getter_AddRefs(pMsgDBHdr)); - if(NS_SUCCEEDED(rv)) + if(NS_SUCCEEDED(rv) && pMsgDBHdr) { nsCOMPtr message; rv = CreateMessageFromMsgDBHdr(pMsgDBHdr, getter_AddRefs(message));