LSP: bugfix - dont break in case of empty stream or protocol objects
This commit is contained in:
parent
0e440231a3
commit
4e03805671
2 changed files with 3 additions and 0 deletions
|
@ -365,6 +365,7 @@ function updateOverview() {
|
||||||
}
|
}
|
||||||
function updateProtocols() {
|
function updateProtocols() {
|
||||||
getData(function(data){
|
getData(function(data){
|
||||||
|
if (!data.config.protocols) { data.config.protocols = []; }
|
||||||
if (data.config.protocols.length != $('#protocols-tbody').children().length) {
|
if (data.config.protocols.length != $('#protocols-tbody').children().length) {
|
||||||
saveAndReload('protocols');
|
saveAndReload('protocols');
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -342,6 +342,7 @@ function showTab(tabName,streamName) {
|
||||||
if (streamName == '_new_') {
|
if (streamName == '_new_') {
|
||||||
settings.newProtocol = {};
|
settings.newProtocol = {};
|
||||||
if (applyInput() === false) { return; }
|
if (applyInput() === false) { return; }
|
||||||
|
if (!settings.settings.config.protocols) { settings.settings.config.protocols = []; }
|
||||||
settings.settings.config.protocols.push(settings.newProtocol);
|
settings.settings.config.protocols.push(settings.newProtocol);
|
||||||
delete settings.newProtocol;
|
delete settings.newProtocol;
|
||||||
}
|
}
|
||||||
|
@ -542,6 +543,7 @@ function showTab(tabName,streamName) {
|
||||||
$('<button>').addClass('enter-to-submit').text('Save').click(function(){
|
$('<button>').addClass('enter-to-submit').text('Save').click(function(){
|
||||||
var newName = $('#settings-streams-'+streamName+'-name').val();
|
var newName = $('#settings-streams-'+streamName+'-name').val();
|
||||||
if (streamName != newName) {
|
if (streamName != newName) {
|
||||||
|
if (!settings.settings.streams) { settings.settings.streams = {}; }
|
||||||
settings.settings.streams[streamName] = {};
|
settings.settings.streams[streamName] = {};
|
||||||
if (applyInput() === false) { return; }
|
if (applyInput() === false) { return; }
|
||||||
settings.settings.streams[newName] = settings.settings.streams[streamName];
|
settings.settings.streams[newName] = settings.settings.streams[streamName];
|
||||||
|
|
Loading…
Add table
Reference in a new issue