fix 45184 crash involving rdf literals r=alecf

This commit is contained in:
bienvenu%netscape.com 2000-07-12 22:54:45 +00:00
Родитель 2d4726af0f
Коммит fc44c4b455
2 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -970,10 +970,10 @@ nsresult nsMsgMessageDataSource::OnChangeStatusString(nsIRDFResource *resource,
NS_ENSURE_SUCCESS(rv, rv);
rv = createStatusNodeFromFlag(newFlag, getter_AddRefs(newNode), PR_TRUE);
NS_ENSURE_TRUE(rv, rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = NotifyPropertyChanged(resource, kNC_StatusString, newNode);
NS_ENSURE_TRUE(rv, rv);
NS_ENSURE_SUCCESS(rv, rv);
return rv;
}
@ -1399,6 +1399,8 @@ nsMsgMessageDataSource::createStatusNodeFromFlag(PRUint32 flags, /*nsAutoString
*node = (needDisplayString) ? kNewLiteralDisplayString : kNewLiteral;
else if(flags & MSG_FLAG_READ)
*node = (needDisplayString) ? kReadLiteralDisplayString : kReadLiteral;
NS_IF_ADDREF(*node);
return rv;
}

Просмотреть файл

@ -345,6 +345,11 @@ NS_IMETHODIMP nsMsgDBFolder::GetFirstNewMessage(nsIMessage **firstNewMessage)
if(NS_FAILED(rv))
return rv;
if (!hdr)
{
*firstNewMessage = nsnull;
return NS_ERROR_FAILURE;
}
rv = CreateMessageFromMsgDBHdr(hdr, firstNewMessage);
if(NS_FAILED(rv))
return rv;
@ -432,6 +437,11 @@ nsresult nsMsgDBFolder::ReadDBFolderInfo(PRBool force)
if (!mInitializedFromCache)
{
folderInfo->GetFlags((PRInt32 *)&mFlags);
#ifdef DEBUG_bienvenu
nsXPIDLString name;
GetName(getter_Copies(name));
NS_ASSERTION(nsCRT::strcmp(name, "Trash") || (mFlags & MSG_FOLDER_FLAG_TRASH), "lost trash flag");
#endif
mInitializedFromCache = PR_TRUE;
}