Fix Bug 282899 Mailing List view does not show all cards. r=neil.parkwaycc.co.uk,sr=bienvenu

This commit is contained in:
bugzilla%standard8.demon.co.uk 2006-01-02 16:25:54 +00:00
Родитель fa923e662d
Коммит a9d6602437
1 изменённых файлов: 26 добавлений и 13 удалений

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

@ -3220,14 +3220,27 @@ nsListAddressEnumerator::HasMoreElements(PRBool *aResult)
return NS_ERROR_NULL_POINTER;
}
if (mAddressPos + 1 <= mAddressTotal)
// In some cases it is possible that GetAddressRowByPos returns success,
// but currentRow is null. This is typically due to the fact that a card
// has been deleted from the parent and not the list. Whilst we have fixed
// that there are still a few dbs around there that we need to support
// correctly. Therefore, whilst processing lists ensure that we don't return
// false if the only thing stopping us is a blank row, just skip it and try
// the next one.
while (mAddressPos < mAddressTotal)
{
nsCOMPtr<nsIMdbRow> currentRow;
nsresult rv = mDb->GetAddressRowByPos(mListRow, mAddressPos + 1,
getter_AddRefs(currentRow));
NS_ENSURE_SUCCESS(rv, rv);
*aResult = currentRow != nsnull;
if (currentRow)
{
*aResult = PR_TRUE;
break;
}
++mAddressPos;
}
return NS_OK;