зеркало из https://github.com/mozilla/pjs.git
bulletproof against num thread children getting to 0 r=jefft
This commit is contained in:
Родитель
65b695518b
Коммит
62562d8fcd
|
@ -830,6 +830,8 @@ nsresult nsMsgThread::ChangeChildCount(PRInt32 delta)
|
|||
childCount += delta;
|
||||
|
||||
NS_ASSERTION((PRInt32) childCount >= 0, "child count gone to 0 or below");
|
||||
if ((PRInt32) childCount <= 0) // force child count to > 0
|
||||
childCount = 1;
|
||||
|
||||
ret = m_mdbDB->UInt32ToRowCellColumn(m_metaRow, m_mdbDB->m_threadChildrenColumnToken, childCount);
|
||||
m_numChildren = childCount;
|
||||
|
@ -867,6 +869,9 @@ nsresult nsMsgThread::GetChildHdrForKey(nsMsgKey desiredKey, nsIMsgDBHdr **resul
|
|||
|
||||
GetNumChildren(&numChildren);
|
||||
|
||||
if ((PRInt32) numChildren < 0)
|
||||
numChildren = 0;
|
||||
|
||||
for (childIndex = 0; childIndex < numChildren; childIndex++)
|
||||
{
|
||||
rv = GetChildHdrAt(childIndex, result);
|
||||
|
|
Загрузка…
Ссылка в новой задаче