From da21edd0d1826def6509cb756664a9dc13b5e2e0 Mon Sep 17 00:00:00 2001 From: "putterman%netscape.com" Date: Tue, 14 Mar 2000 05:29:34 +0000 Subject: [PATCH] r=bienvenu. Don't fail if there's no unread thread. --- .../base/src/nsMsgViewNavigationService.cpp | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/mailnews/base/src/nsMsgViewNavigationService.cpp b/mailnews/base/src/nsMsgViewNavigationService.cpp index 556e953dae62..9349825d3c2c 100644 --- a/mailnews/base/src/nsMsgViewNavigationService.cpp +++ b/mailnews/base/src/nsMsgViewNavigationService.cpp @@ -1132,23 +1132,24 @@ nsresult nsMsgViewNavigationService::GetNextMessageByThread(nsIDOMXULElement *st if(NS_FAILED(rv)) return rv; - nsCOMPtr nextMessageElement; - - rv = FindNextInThread(info->type, info->tree, nextTopMessage, info->rdfService, - info->document, getter_AddRefs(nextMessageElement)); - if(NS_FAILED(rv)) - return rv; - - if(nextMessageElement) + if(nextTopMessage) { - rv = nextMessageElement->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)nextMessage); - return rv; - } - else - { - return NS_OK; + nsCOMPtr nextMessageElement; + + rv = FindNextInThread(info->type, info->tree, nextTopMessage, info->rdfService, + info->document, getter_AddRefs(nextMessageElement)); + if(NS_FAILED(rv)) + return rv; + + if(nextMessageElement) + { + rv = nextMessageElement->QueryInterface(NS_GET_IID(nsIDOMNode), (void**)nextMessage); + return rv; + } } + return NS_OK; + } //Given a message, searches from siblings onward to find the next message. This is for the threaded view.