fix crash cancelling fcc to imap folder, sr=mscott, patch suggested by laurentiu dumitrescu 206408

This commit is contained in:
bienvenu%nventure.com 2006-10-06 20:55:43 +00:00
parent cba6ca4f6e
commit 55c751ffa4

View File

@ -1652,9 +1652,14 @@ nsresult nsImapProtocol::SendData(const char * dataBuffer, PRBool aSuppressLoggi
else
Log("SendData", nsnull, "Logging suppressed for this command (it probably contained authentication information)");
PRUint32 n;
rv = m_outputStream->Write(dataBuffer, PL_strlen(dataBuffer), &n);
{
// don't allow someone to close the stream/transport out from under us
// this can happen when the ui thread calls TellThreadToDie.
nsAutoCMonitor mon(this);
PRUint32 n;
if (m_outputStream)
rv = m_outputStream->Write(dataBuffer, PL_strlen(dataBuffer), &n);
}
if (NS_FAILED(rv))
{
Log("SendData", nsnull, "clearing IMAP_CONNECTION_IS_OPEN");