From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 09019719C8 for ; Thu, 20 May 2021 16:59:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 05F48267EB for ; Thu, 20 May 2021 16:59:19 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id DD072267DA for ; Thu, 20 May 2021 16:59:17 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B6F7246614 for ; Thu, 20 May 2021 16:59:17 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Thu, 20 May 2021 16:59:14 +0200 Message-Id: <20210520145916.23222-2-d.csapak@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210520145916.23222-1-d.csapak@proxmox.com> References: <20210520145916.23222-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager 1/3] ui: Parser: fix bind and dev mounts for lxc X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2021 14:59:19 -0000 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'; -- 2.20.1