Skip to content

Commit

Permalink
fixed crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ArkadySK committed May 23, 2024
1 parent cc44dbd commit 3da1640
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions GbxMapBrowser/MapInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ public MapInfo(string fullnamepath, bool basicInfoOnly)
? enviImagePath
: new Uri(Environment.CurrentDirectory + "\\Data\\Environments\\Unknown.png");

bool isRace = challenge.Mode == CGameCtnChallenge.PlayMode.Race || challenge.MapType.EndsWith("Race");
MapType = string.IsNullOrEmpty(challenge.ChallengeParameters?.MapType)
? challenge.Mode.ToString()
: challenge.ChallengeParameters.MapType;

bool isRace = challenge.Mode == CGameCtnChallenge.PlayMode.Race || MapType.EndsWith("Race");

ObjectiveAuthor = !string.IsNullOrEmpty(challenge.ObjectiveTextAuthor) && !isRace
? challenge.ObjectiveTextAuthor
Expand All @@ -97,10 +101,6 @@ public MapInfo(string fullnamepath, bool basicInfoOnly)

CopperPrice = challenge.Cost.ToString();

MapType = string.IsNullOrEmpty(challenge.ChallengeParameters.MapType)
? challenge.Mode.ToString()
: challenge.ChallengeParameters.MapType;

if (challenge.Thumbnail == null)
{
MapThumbnail = new BitmapImage(new Uri(Environment.CurrentDirectory + "\\Data\\UIIcons\\NoThumbnail.png"));
Expand Down

0 comments on commit 3da1640

Please sign in to comment.