public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/3] ui: form/GroupFilter: improve group load callback handling
Date: Wed,  1 Dec 2021 11:57:07 +0100	[thread overview]
Message-ID: <20211201105708.3150068-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20211201105708.3150068-1-d.csapak@proxmox.com>

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>
---
 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





  reply	other threads:[~2021-12-01 10:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 10:57 [pbs-devel] [PATCH proxmox-backup 1/3] ui: form/GroupFilter: correctly resolve the reference cycle Dominik Csapak
2021-12-01 10:57 ` Dominik Csapak [this message]
2021-12-01 10:57 ` [pbs-devel] [PATCH proxmox-backup 3/3] ui: form/GroupFilter: copy records for the pbsGroupSelectors Dominik Csapak
2021-12-01 13:33 ` [pbs-devel] applied-series: [PATCH proxmox-backup 1/3] ui: form/GroupFilter: correctly resolve the reference cycle Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211201105708.3150068-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal