Fixed nullref
This commit is contained in:
parent
be9394c3a5
commit
5f3466ad23
2 changed files with 7 additions and 2 deletions
|
|
@ -88,7 +88,12 @@ namespace LightReflectiveMirror.LoadBalancing
|
||||||
{
|
{
|
||||||
string receivedStats = await wc.DownloadStringTaskAsync($"http://{serverIP}:{port}{API_PATH}");
|
string receivedStats = await wc.DownloadStringTaskAsync($"http://{serverIP}:{port}{API_PATH}");
|
||||||
|
|
||||||
return JsonConvert.DeserializeObject<RelayServerInfo>(receivedStats);
|
var stats = JsonConvert.DeserializeObject<RelayServerInfo>(receivedStats);
|
||||||
|
|
||||||
|
if (stats.serversConnectedToRelay == null)
|
||||||
|
stats.serversConnectedToRelay = new List<Room>();
|
||||||
|
|
||||||
|
return stats;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ namespace LightReflectiveMirror.LoadBalancing
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
bool DoesServerIdExist(string id)
|
bool DoesServerIdExist(string id)
|
||||||
{
|
{
|
||||||
var infos = new List<RelayServerInfo>(availableRelayServers.Values.ToList());
|
var infos = availableRelayServers.Values;
|
||||||
|
|
||||||
foreach (var info in infos)
|
foreach (var info in infos)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue