[pmg-devel] applied: [PATCH pmg-gui] fix MailInfo update without data

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Apr 16 14:51:16 CEST 2020


On 4/16/20 12:25 PM, Dominik Csapak wrote:
> e.g. when the user changes the email while having a mail selected,
> it gets unselected (albeit briefly) and update will be called
> with 'undefined'
> 
> this throws an error, so prevent this by always supplying an object
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  js/MailInfo.js | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/js/MailInfo.js b/js/MailInfo.js
> index 982ed0e..89cc78c 100644
> --- a/js/MailInfo.js
> +++ b/js/MailInfo.js
> @@ -11,7 +11,7 @@ Ext.define('PMG.MailInfoBox', {
>      update: function(data) {
>  	let me = this;
>  	let escaped = {};
> -	for (const [key, value] of Object.entries(data)) {
> +	for (const [key, value] of Object.entries(data || {})) {
>  	    escaped[key] = Ext.util.Format.ellipsis(Ext.htmlEncode(value), 103);
>  	}
>  	me.items.each((item) => item.update(escaped));
> 

applied, thanks!



More information about the pmg-devel mailing list