Add error handling in watch_manual_resize().

We now explicitly complain if a caller passes in a bad
selector to this function and return undefined.
This commit is contained in:
Steve Howell
2017-05-11 09:28:33 -07:00
committed by Tim Abbott
parent 35a5ca411a
commit d415d4cf11
2 changed files with 11 additions and 2 deletions

View File

@@ -167,8 +167,15 @@ function left_userlist_get_new_heights() {
exports.watch_manual_resize = function (element) {
return (function on_box_resize(cb) {
var box = document.querySelector(element);
if (!box) {
blueslip.error('Bad selector in watch_manual_resize: ' + element);
return;
}
var meta = {
box: document.querySelector(element),
box: box,
height: null,
mousedown: false,
};