From 461bb2e56cb512bde8e8da6499809613b941bf3b Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval Date: Thu, 18 Jan 2024 15:14:10 +0100 Subject: [PATCH] certificates: removal prompt: don't display name if there is no name The default certificate does not have a name, which caused this to display an undefined text in the prompt. Reported-by: Dietmar Maurer Signed-off-by: Maximiliano Sandoval [ TL: drop useless instance of calling format, keep arrow-fn ] Signed-off-by: Thomas Lamprecht --- src/panel/Certificates.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/panel/Certificates.js b/src/panel/Certificates.js index a522ab6..3be5546 100644 --- a/src/panel/Certificates.js +++ b/src/panel/Certificates.js @@ -237,10 +237,16 @@ Ext.define('Proxmox.panel.Certificates', { { xtype: 'proxmoxButton', text: gettext('Delete Custom Certificate'), - confirmMsg: rec => Ext.String.format( - gettext('Are you sure you want to remove the certificate used for {0}'), - me.certById[rec.id].name, - ), + confirmMsg: rec => { + let cert = me.certById[rec.id]; + if (cert.name) { + return Ext.String.format( + gettext('Are you sure you want to remove the certificate used for {0}'), + cert.name, + ); + } + return gettext('Are you sure you want to remove the certificate'); + }, callback: () => me.reload(), selModel: me.selModel, disabled: true,