From 1d3857273341e92d96ab4f38edda3c438958e695 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 18 Jan 2016 15:55:24 +0000 Subject: [PATCH] Handle add channel state with empty pts --- app/js/services.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/js/services.js b/app/js/services.js index dd036724..cbe48856 100755 --- a/app/js/services.js +++ b/app/js/services.js @@ -2828,6 +2828,9 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) } function addChannelState (channelID, pts) { + if (!pts) { + throw new Error('Add channel state without pts ' + channelID); + } if (channelStates[channelID] === undefined) { channelStates[channelID] = { pts: pts, @@ -2842,9 +2845,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) function getChannelState (channelID, pts) { if (channelStates[channelID] === undefined) { - if (!pts) { - throw new Error('Get channel empty state without pts ' + channelID); - } addChannelState(channelID, pts); } return channelStates[channelID];