зеркало из https://github.com/mozilla/gecko-dev.git
fix for #74930. Go | Next | Message crashes on an empty view.
sr=bienvenu
This commit is contained in:
Родитель
9586d7ac8c
Коммит
8b19b98722
|
@ -3430,7 +3430,7 @@ nsresult nsMsgDBView::MarkThreadRead(nsIMsgThread *threadHdr, nsMsgViewIndex thr
|
||||||
|
|
||||||
// Starting from startIndex, performs the passed in navigation, including
|
// Starting from startIndex, performs the passed in navigation, including
|
||||||
// any marking read needed, and returns the resultId and resultIndex of the
|
// any marking read needed, and returns the resultId and resultIndex of the
|
||||||
// destination of the navigation. If there are no more unread in the view,
|
// destination of the navigation. If no message is found in the view,
|
||||||
// it returns a resultId of nsMsgKey_None and an resultIndex of nsMsgViewIndex_None.
|
// it returns a resultId of nsMsgKey_None and an resultIndex of nsMsgViewIndex_None.
|
||||||
NS_IMETHODIMP nsMsgDBView::ViewNavigate(nsMsgNavigationTypeValue motion, nsMsgKey *pResultKey, nsMsgViewIndex *pResultIndex, nsMsgViewIndex *pThreadIndex, PRBool wrap)
|
NS_IMETHODIMP nsMsgDBView::ViewNavigate(nsMsgNavigationTypeValue motion, nsMsgKey *pResultKey, nsMsgViewIndex *pResultIndex, nsMsgViewIndex *pThreadIndex, PRBool wrap)
|
||||||
{
|
{
|
||||||
|
@ -3462,16 +3462,17 @@ nsresult nsMsgDBView::NavigateFromPos(nsMsgNavigationTypeValue motion, nsMsgView
|
||||||
nsMsgViewIndex lastIndex = (GetSize() > 0) ? (nsMsgViewIndex) GetSize() - 1 : nsMsgViewIndex_None;
|
nsMsgViewIndex lastIndex = (GetSize() > 0) ? (nsMsgViewIndex) GetSize() - 1 : nsMsgViewIndex_None;
|
||||||
nsMsgViewIndex threadIndex = nsMsgViewIndex_None;
|
nsMsgViewIndex threadIndex = nsMsgViewIndex_None;
|
||||||
|
|
||||||
switch (motion) {
|
// if there aren't any messages in the view, bail out.
|
||||||
case nsMsgNavigationType::firstMessage:
|
if (GetSize() <= 0) {
|
||||||
if (GetSize() > 0) {
|
|
||||||
*pResultIndex = 0;
|
|
||||||
*pResultKey = m_keys.GetAt(0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
*pResultIndex = nsMsgViewIndex_None;
|
*pResultIndex = nsMsgViewIndex_None;
|
||||||
*pResultKey = nsMsgKey_None;
|
*pResultKey = nsMsgKey_None;
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (motion) {
|
||||||
|
case nsMsgNavigationType::firstMessage:
|
||||||
|
*pResultIndex = 0;
|
||||||
|
*pResultKey = m_keys.GetAt(0);
|
||||||
break;
|
break;
|
||||||
case nsMsgNavigationType::nextMessage:
|
case nsMsgNavigationType::nextMessage:
|
||||||
// return same index and id on next on last message
|
// return same index and id on next on last message
|
||||||
|
|
Загрузка…
Ссылка в новой задаче