mirror of
https://git.proxmox.com/git/pmg-gui
synced 2025-08-15 12:59:37 +00:00
fix broken maillist when deleting last mail in list
on deleting the last mail in the list, the selection is empty and the access below to 'rec.data.id' breaks, leaving the maillist broken (until the user changed the panel or reloaded) so give rec an empty fallback object and check if there is a 'data' property and use that, otherwise set the id to the empty string Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com> Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
This commit is contained in:
parent
721ad44864
commit
38771d946b
@ -154,9 +154,10 @@ Ext.define('PMG.SpamQuarantine', {
|
||||
me.multiSelect();
|
||||
return;
|
||||
}
|
||||
var rec = selection[0];
|
||||
|
||||
me.getViewModel().set('mailid', rec.data.id);
|
||||
var rec = selection[0] || {};
|
||||
|
||||
me.getViewModel().set('mailid', rec.data ? rec.data.id : '');
|
||||
me.updatePreview(me.raw || false, rec);
|
||||
me.lookupReference('spaminfo').setID(rec);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user