On 7/7/23 10:02, Fiona Ebner wrote:
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.eb...@proxmox.com>
---
New in v2.
www/manager6/form/VMSelector.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/www/manager6/form/VMSelector.js b/www/manager6/form/VMSelector.js
index bf2c8df7..4b04ac30 100644
--- a/www/manager6/form/VMSelector.js
+++ b/www/manager6/form/VMSelector.js
@@ -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);
LGTM
Reviewed-by: Dominik Csapak <d.csa...@proxmox.com>
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel