зеркало из https://github.com/mozilla/pjs.git
don't allow thread unread counts to be negative r=naving, sr=mscott fixes one case of 64476
This commit is contained in:
Родитель
7a819a744f
Коммит
0acb8185bc
|
@ -94,6 +94,8 @@ nsresult nsMsgThread::InitCachedValues()
|
|||
// NS_ASSERTION(m_numChildren <= rowCount, "num children wrong - fixing");
|
||||
if (m_numChildren > rowCount)
|
||||
ChangeChildCount((PRInt32) rowCount - (PRInt32) m_numChildren);
|
||||
if ((PRInt32) m_numUnreadChildren < 0)
|
||||
ChangeUnreadChildCount(- (PRInt32) m_numUnreadChildren);
|
||||
if (NS_SUCCEEDED(err))
|
||||
m_cachedValuesInitialized = PR_TRUE;
|
||||
}
|
||||
|
@ -963,7 +965,13 @@ nsresult nsMsgThread::ChangeUnreadChildCount(PRInt32 delta)
|
|||
PRUint32 childCount = 0;
|
||||
m_mdbDB->RowCellColumnToUInt32(m_metaRow, m_mdbDB->m_threadUnreadChildrenColumnToken, childCount);
|
||||
childCount += delta;
|
||||
|
||||
if ((PRInt32) childCount < 0)
|
||||
{
|
||||
#ifdef DEBUG_bienvenu
|
||||
NS_ASSERTION(PR_FALSE, "negative unread child count");
|
||||
#endif
|
||||
childCount = 0;
|
||||
}
|
||||
ret = m_mdbDB->UInt32ToRowCellColumn(m_metaRow, m_mdbDB->m_threadUnreadChildrenColumnToken, childCount);
|
||||
m_numUnreadChildren = childCount;
|
||||
return ret;
|
||||
|
|
Загрузка…
Ссылка в новой задаче