From 4e038056711942392eff9733306b449477c465a4 Mon Sep 17 00:00:00 2001 From: cat Date: Thu, 2 Jan 2014 14:03:08 +0100 Subject: [PATCH] LSP: bugfix - dont break in case of empty stream or protocol objects --- lsp/main.js | 1 + lsp/pages.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lsp/main.js b/lsp/main.js index 82cdd0e7..c7522998 100755 --- a/lsp/main.js +++ b/lsp/main.js @@ -365,6 +365,7 @@ function updateOverview() { } function updateProtocols() { getData(function(data){ + if (!data.config.protocols) { data.config.protocols = []; } if (data.config.protocols.length != $('#protocols-tbody').children().length) { saveAndReload('protocols'); return; diff --git a/lsp/pages.js b/lsp/pages.js index 8e87797d..e5599cd9 100755 --- a/lsp/pages.js +++ b/lsp/pages.js @@ -342,6 +342,7 @@ function showTab(tabName,streamName) { if (streamName == '_new_') { settings.newProtocol = {}; if (applyInput() === false) { return; } + if (!settings.settings.config.protocols) { settings.settings.config.protocols = []; } settings.settings.config.protocols.push(settings.newProtocol); delete settings.newProtocol; } @@ -542,6 +543,7 @@ function showTab(tabName,streamName) { $('