Fix null reference potential if PCGamingWiki returns improper results
This commit is contained in:
parent
470228624d
commit
3c70682fb0
1 changed files with 26 additions and 22 deletions
|
@ -86,8 +86,11 @@ namespace LANCommander.Controllers
|
|||
MultiplayerModes = new List<MultiplayerMode>()
|
||||
};
|
||||
|
||||
|
||||
var playerCounts = await PCGamingWikiClient.GetMultiplayerPlayerCounts(result.Name);
|
||||
|
||||
if (playerCounts != null)
|
||||
{
|
||||
foreach (var playerCount in playerCounts)
|
||||
{
|
||||
MultiplayerType type;
|
||||
|
@ -117,6 +120,7 @@ namespace LANCommander.Controllers
|
|||
MinPlayers = 2
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (result.GameModes != null && result.GameModes.Values != null)
|
||||
viewModel.Game.Singleplayer = result.GameModes.Values.Any(gm => gm.Name == "Singleplayer");
|
||||
|
|
Loading…
Add table
Reference in a new issue