fix for #161333. fix js warning when there are no selected messages.

r/sr=bienvenu.  leaving the (possible) perf improvements for ssu.
This commit is contained in:
sspitzer%netscape.com 2002-08-07 07:10:31 +00:00
parent 684e3d5957
commit f20768d863

View File

@ -1075,7 +1075,16 @@ function GetFirstSelectedMessage()
// Use this instead of gDBView.URIForFirstSelectedMessage, else it // Use this instead of gDBView.URIForFirstSelectedMessage, else it
// will return the currentIndex message instead of the highlighted // will return the currentIndex message instead of the highlighted
// message. // message.
return GetSelectedMessages()[0]; //
// note, there may not be any selected messages
//
// XXX todo
// is this inefficient when we've got a lot of message selected?
var selectedMessages = GetSelectedMessages();
if (selectedMessages)
return selectedMessages[0];
else
return null;
} }
catch (ex) { catch (ex) {
return null; return null;