Skip to content

Commit 29f3d1a

Browse files
When route not found and amount of routes is 1 default to this one and only route
1 parent 2ad0090 commit 29f3d1a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

Source/Menu/DownloadContentForm.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,23 @@ private int determineSelectedIndex(ComboBox comboBox, string compareWith)
883883
}
884884
else
885885
{
886-
throw new StartNotFound(Catalog.GetStringFmt(compareWith));
886+
if (classOfItem == "Route")
887+
{
888+
// if a route is not found and amount of routes is 1
889+
// then default to this one and only route
890+
if (comboBox.Items.Count == 1)
891+
{
892+
index = 0;
893+
}
894+
else
895+
{
896+
throw new StartNotFound(Catalog.GetStringFmt(compareWith));
897+
}
898+
}
899+
else
900+
{
901+
throw new StartNotFound(Catalog.GetStringFmt(compareWith));
902+
}
887903
}
888904

889905
return index;

0 commit comments

Comments
 (0)