mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
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:
parent
684e3d5957
commit
f20768d863
@ -1075,7 +1075,16 @@ function GetFirstSelectedMessage()
|
||||
// Use this instead of gDBView.URIForFirstSelectedMessage, else it
|
||||
// will return the currentIndex message instead of the highlighted
|
||||
// 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) {
|
||||
return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user