From 4a7248d4ea934fa9adf13145c930f39246eb6b52 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 4 Oct 2019 16:07:49 +0200 Subject: [PATCH] ui: make parsePropertyString less picky simply return a empty object for cases we would get an exception anyway, this is not wrong and allows easier usage for cases where it's not sure if the value is set or not. We could still do a Ext.isDebugEnabled() check and then throw up, but this really should not matter much and I do not like if my debug mode breaks and the non-debug not.. Signed-off-by: Thomas Lamprecht --- www/manager6/Parser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/manager6/Parser.js b/www/manager6/Parser.js index 14e7af3a..9dfabfea 100644 --- a/www/manager6/Parser.js +++ b/www/manager6/Parser.js @@ -49,6 +49,10 @@ Ext.define('PVE.Parser', { statics: { var res = {}, error; + if (typeof value !== 'string' || value === '') { + return res; + } + Ext.Array.each(value.split(','), function(p) { var kv = p.split('=', 2); if (Ext.isDefined(kv[1])) {