From 1e66b16da97f39145c274e01c3eb533ed9b4f9de Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Sat, 19 Oct 2013 14:07:08 -0400 Subject: [PATCH] Fix: do not handle empty hotlist message --- js/websockets.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/websockets.js b/js/websockets.js index c9c1ff8..0cedf7a 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -103,6 +103,9 @@ weechat.factory('handlers', ['$rootScope', 'colors', 'models', 'plugins', functi * Handle answers to hotlist request */ var handleHotlistInfo = function(message) { + if (message.objects.length == 0) { + return; + } var hotlist = message['objects'][0]['content']; hotlist.forEach(function(l) { var buffer = models.getBuffer(l.buffer);