From fc868f5a5fca7b44aba27706912942ae3dfd083d Mon Sep 17 00:00:00 2001 From: Danilo Del Busso Date: Tue, 1 Aug 2023 09:51:03 +0100 Subject: [PATCH] CA-380718: Ensure language code is passed when running `PerfmonOptionsDefinitionAction` `SelectedValue` is always `null` because of the use of `ToStringWrapper` Signed-off-by: Danilo Del Busso --- XenAdmin/SettingsPanels/PerfmonAlertOptionsPage.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XenAdmin/SettingsPanels/PerfmonAlertOptionsPage.cs b/XenAdmin/SettingsPanels/PerfmonAlertOptionsPage.cs index f46528433..5b45aaab7 100755 --- a/XenAdmin/SettingsPanels/PerfmonAlertOptionsPage.cs +++ b/XenAdmin/SettingsPanels/PerfmonAlertOptionsPage.cs @@ -222,8 +222,8 @@ namespace XenAdmin.SettingsPanels mailDestination = EmailAddressTextBox.Text; mailHub = SmtpServerAddrTextBox.Text + ":" + SmtpServerPortTextBox.Text; - if (MailLanguageComboBox.Visible && MailLanguageComboBox.SelectedValue != null) - mailLangCode = MailLanguageComboBox.SelectedValue.ToString(); + if (MailLanguageComboBox.Visible && MailLanguageComboBox.SelectedItem is ToStringWrapper stringWrapper && !string.IsNullOrEmpty(stringWrapper.item)) + mailLangCode = stringWrapper.item; } return new PerfmonOptionsDefinitionAction(_XenModelObject.Connection, mailDestination, mailHub, mailLangCode, true);