]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: Parser: fix bind and dev mounts for lxc
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 20 May 2021 14:59:14 +0000 (16:59 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 20 May 2021 19:01:49 +0000 (21:01 +0200)
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 <d.csapak@proxmox.com>
www/manager6/Parser.js

index 1db82331ce6e82bcf83f93624e9dd85e29aec655..bb6a9a338076221494c58259f3be514b44b5c1d2 100644 (file)
@@ -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';