]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: vm selector: don't add invalid not found items
authorFiona Ebner <f.ebner@proxmox.com>
Mon, 25 Sep 2023 11:58:40 +0000 (13:58 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 27 Sep 2023 14:53:14 +0000 (16:53 +0200)
Doing a simple numericity check and warn in the console so developers
can notice if there is something off.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/form/VMSelector.js

index 0c884aaead5530dd5663569603f9bde213611b80..22f7dd11d5b6619d6d372dbe46a61a8aa8b8a225 100644 (file)
@@ -136,7 +136,11 @@ Ext.define('PVE.form.VMSelector', {
        let selection = value.map(item => {
            let found = store.findRecord('vmid', item, 0, false, true, true);
            if (!found) {
-               notFound.push(item);
+               if (Ext.isNumeric(item)) {
+                   notFound.push(item);
+               } else {
+                   console.warn(`invalid item in vm selection: ${item}`);
+               }
            }
            return found;
        }).filter(r => r);