From 7984327d817a47df3ae466a79752bb1549a5793e Mon Sep 17 00:00:00 2001 From: Marc-Andre Ferland Date: Tue, 6 Dec 2022 11:19:05 -0500 Subject: [PATCH] Fixed tasks buttons by replacing the error with a warning when setting properties to undefined. (#618) --- ui/media/js/engine.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/media/js/engine.js b/ui/media/js/engine.js index 3efa095c..d3c20328 100644 --- a/ui/media/js/engine.js +++ b/ui/media/js/engine.js @@ -806,6 +806,11 @@ continue } if (key in TASK_OPTIONAL) { + if (typeof this._reqBody[key] == "undefined") { + delete this._reqBody[key] + console.warn(`reqBody[${key}] was set to undefined. Removing optional key without value...`) + continue + } if (typeof this._reqBody[key] !== TASK_OPTIONAL[key]) { throw new Error(`${key} need to be of type ${TASK_OPTIONAL[key]} but ${typeof this._reqBody[key]} was found.`) }