From 36a35628e294dd6d5c09c615f15ec155a61012c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sat, 3 May 2014 14:12:55 +0100 Subject: [PATCH] Fix bug where updateNickSpeak would fail on lines without a prefix --- js/models.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/models.js b/js/models.js index 08af87d..53ef7b2 100644 --- a/js/models.js +++ b/js/models.js @@ -92,6 +92,10 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter) var updateNickSpeak = function(line) { // Try to find nick from prefix var prefix = line.prefix; + if (prefix.length === 0) { + // some scripts produce lines without a prefix + return; + } var nick = prefix[prefix.length - 1].text; // Action / me, find the nick as the first word of the message if (nick === " *") {