[pbs-devel] [PATCH proxmox-backup 2/3] ui: form/GroupFilter: improve group load callback handling

Dominik Csapak d.csapak at proxmox.com
Wed Dec 1 11:57:07 CET 2021


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 at proxmox.com>
---
 www/form/GroupFilter.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/www/form/GroupFilter.js b/www/form/GroupFilter.js
index 5c75f1d0..11aa24c4 100644
--- a/www/form/GroupFilter.js
+++ b/www/form/GroupFilter.js
@@ -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 || []);
 		});
 	    },
 	});
-- 
2.30.2






More information about the pbs-devel mailing list