From f5a992dde08ec64fc8937406c9a065256f4db731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Wed, 27 Feb 2019 17:07:53 +0100 Subject: [PATCH] Update list_change.js --- server/handlers/list_change.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/handlers/list_change.js b/server/handlers/list_change.js index a99e12d7..aed7b49c 100644 --- a/server/handlers/list_change.js +++ b/server/handlers/list_change.js @@ -319,8 +319,7 @@ function add_function(arr, coll, guid, offline, socket) { var socketid = socket.zoff_id; if(typeof(arr) === 'object' && arr !== undefined && arr !== null && arr !== "" && !isNaN(parseInt(arr.duration))) { - if(coll == "" || coll == undefined || coll == null || - !arr.hasOwnProperty("start") || !arr.hasOwnProperty("end")) { + if(coll == "" || coll == undefined || coll == null || !arr.hasOwnProperty("duration")) { var result = { start: { expected: "number or string that can be cast to int", @@ -336,6 +335,8 @@ function add_function(arr, coll, guid, offline, socket) { } try { + if(arr.start == undefined) arr.start = 0; + if(arr.end == undefined) arr.end = parseInt(arr.duration); var start = parseInt(arr.start); var end = parseInt(arr.end); if(start < 0) {