From 308d9f365c2cc29d4b49ee649f20b02098fdf9c1 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 20 May 2021 16:59:14 +0200 Subject: [PATCH] ui: Parser: fix bind and dev mounts for lxc match returns 'null' if the regex does not match, which is not destructurable. so we have to save the match and check if it valid Signed-off-by: Dominik Csapak --- www/manager6/Parser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/manager6/Parser.js b/www/manager6/Parser.js index 1db82331..bb6a9a33 100644 --- a/www/manager6/Parser.js +++ b/www/manager6/Parser.js @@ -367,9 +367,9 @@ Ext.define('PVE.Parser', { return undefined; } - const [, storage] = res.file.match(/^([a-z][a-z0-9\-_.]*[a-z0-9]):/i); - if (storage) { - res.storage = storage; + const match = res.file.match(/^([a-z][a-z0-9\-_.]*[a-z0-9]):/i); + if (match) { + res.storage = match[1]; res.type = 'volume'; } else if (res.file.match(/^\/dev\//)) { res.type = 'device';