mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
Avoid throwing an exception when there are no CDs in the New VM wizard dropdown
The rest of the code is robust to there being no CDs (and e.Index = -1) apart from this bit. Signed-off-by: David Scott <dave.scott@eu.citrix.com>
This commit is contained in:
parent
71eea27965
commit
292b333078
@ -335,7 +335,9 @@ namespace XenAdmin.Wizards.NewVMWizard
|
||||
|
||||
private void AddToolTipToCdDropDownBox_DrawItemEvent(object sender, DrawItemEventArgs e)
|
||||
{
|
||||
string selectedText = CdDropDownBox.GetItemText(CdDropDownBox.Items[e.Index]);
|
||||
string selectedText = "";
|
||||
if (e.Index != -1)
|
||||
selectedText = CdDropDownBox.GetItemText(CdDropDownBox.Items[e.Index]);
|
||||
|
||||
Font font = (e.Index != -1 && CdDropDownBox.Items[e.Index] is ToStringWrapper<SR>) ? Program.DefaultFontBold : Program.DefaultFont;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user