Skip to content

Commit

Permalink
Improve error message in message_list.select_id().
Browse files Browse the repository at this point in the history
  • Loading branch information
showell committed Mar 27, 2017
1 parent 6314f60 commit 24ee369
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions static/js/message_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 24ee369

Please sign in to comment.