Improve error message in message_list.select_id().

This commit is contained in:
Steve Howell 2017-03-27 10:26:30 -07:00
parent 6314f60edc
commit 24ee369d43
1 changed files with 8 additions and 3 deletions

View File

@ -157,11 +157,16 @@ exports.MessageList.prototype = {
previously_selected: this._selected_id,
});
id = parseFloat(id);
if (isNaN(id)) {
blueslip.fatal("Bad message id");
function convert_id(str_id) {
var id = parseFloat(str_id);
if (isNaN(id)) {
blueslip.fatal("Bad message id " + str_id);
}
return id;
}
id = convert_id(id);
var closest_id = this.closest_id(id);
// The name "use_closest" option is a bit legacy. We