Fix Radios crash

This commit is contained in:
Théo Marchal 2022-04-12 23:14:13 +02:00
parent 4136c13d5b
commit f95b884d16

View File

@ -77,6 +77,8 @@ namespace unison
} }
public async void Initialize() public async void Initialize()
{
try
{ {
List<NameAndCount> Countries = await _radioBrowser.Lists.GetCountriesAsync(); List<NameAndCount> Countries = await _radioBrowser.Lists.GetCountriesAsync();
CountryList.Items.Add(new CountryListItem { Name = "", Count = 0 }); CountryList.Items.Add(new CountryListItem { Name = "", Count = 0 });
@ -90,6 +92,12 @@ namespace unison
}); });
} }
} }
catch (Exception e)
{
Debug.WriteLine("Exception while getting countries in RadioBrowser: " + e.Message);
return;
}
}
private string CleanString(string str) private string CleanString(string str)
{ {