]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
fix #4951: accept undefined as value for the MultiDiskSelector
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 7 Sep 2023 12:18:05 +0000 (14:18 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 7 Sep 2023 15:49:38 +0000 (17:49 +0200)
otherwise it tries to string split it and throws an exception

This can happen when there was no initial value and the form is reset.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/form/MultiDiskSelector.js

index 88cdc807c85adc90feab6b1ea44b6ef07dec4b58..33bcf28cc83265633521a8136a3899da2fca2d4e 100644 (file)
@@ -39,6 +39,8 @@ Ext.define('Proxmox.form.MultiDiskSelector', {
     setValue: function(value) {
        let me = this;
 
+       value ??= [];
+
        if (!Ext.isArray(value)) {
            value = value.split(/;, /);
        }