[pve-devel] [PATCH v3 manager 3/3] ui: vm selector: gracefully handle undefined/null in setValue function

Fiona Ebner f.ebner at proxmox.com
Mon Sep 25 13:58:41 CEST 2023


Suggested-by: Dominik Csapak <d.csapak at proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---

New in v3.

 www/manager6/form/VMSelector.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/www/manager6/form/VMSelector.js b/www/manager6/form/VMSelector.js
index 22f7dd11..d59847f2 100644
--- a/www/manager6/form/VMSelector.js
+++ b/www/manager6/form/VMSelector.js
@@ -165,6 +165,7 @@ Ext.define('PVE.form.VMSelector', {
 
     setValue: function(value) {
 	let me = this;
+	value ??= [];
 	if (!Ext.isArray(value)) {
 	    value = value.split(',').filter(v => v !== '');
 	}
-- 
2.39.2






More information about the pve-devel mailing list