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 <danilo.delbusso@cloud.com>
This commit is contained in:
Danilo Del Busso 2023-08-01 09:51:03 +01:00 committed by Konstantina Chremmou
parent 3afaff18f8
commit fc868f5a5f

View File

@ -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<string> stringWrapper && !string.IsNullOrEmpty(stringWrapper.item))
mailLangCode = stringWrapper.item;
}
return new PerfmonOptionsDefinitionAction(_XenModelObject.Connection, mailDestination, mailHub, mailLangCode, true);