ui: form/GroupFilter: improve group load callback handling

if 'me' is already destroyed here, return
if records is 'null' (which can happen on a not successful load),
load an empty list instead

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-12-01 11:57:07 +01:00 committed by Thomas Lamprecht
parent d0d970f70b
commit b3c7567e3c

View File

@ -214,8 +214,11 @@ Ext.define('PBS.form.GroupFilter', {
me.setDsStoreUrl(url);
me.dsStore.load({
callback: (records) => {
if (me.isDestroyed) {
return;
}
me.query('pbsGroupSelector').forEach((selector) => {
selector.getStore().setData(records);
selector.getStore().setData(records || []);
});
},
});