From 99f396b652ef925f3dd4a233217b34aa8b0b9824 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Sat, 7 Mar 2015 13:00:05 +0100 Subject: [PATCH] Check that nicklist exists before updating. --- js/models.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/models.js b/js/models.js index 6ee7295..db27acd 100644 --- a/js/models.js +++ b/js/models.js @@ -134,6 +134,12 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter) */ var updateNick = function(group, nick) { group = nicklist[group]; + if (group === undefined) { + // We are getting nicklist events for a buffer where not yet + // have populated the nicklist, so there will be nothing to + // update. Just ignore the event. + return; + } for(var i in group.nicks) { if (group.nicks[i].name === nick.name) { group.nicks[i] = nick;