Skip to content

Commit 3da1640

Browse files
committed
fixed crash
1 parent cc44dbd commit 3da1640

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

GbxMapBrowser/MapInfo.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ public MapInfo(string fullnamepath, bool basicInfoOnly)
7373
? enviImagePath
7474
: new Uri(Environment.CurrentDirectory + "\\Data\\Environments\\Unknown.png");
7575

76-
bool isRace = challenge.Mode == CGameCtnChallenge.PlayMode.Race || challenge.MapType.EndsWith("Race");
76+
MapType = string.IsNullOrEmpty(challenge.ChallengeParameters?.MapType)
77+
? challenge.Mode.ToString()
78+
: challenge.ChallengeParameters.MapType;
79+
80+
bool isRace = challenge.Mode == CGameCtnChallenge.PlayMode.Race || MapType.EndsWith("Race");
7781

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

98102
CopperPrice = challenge.Cost.ToString();
99103

100-
MapType = string.IsNullOrEmpty(challenge.ChallengeParameters.MapType)
101-
? challenge.Mode.ToString()
102-
: challenge.ChallengeParameters.MapType;
103-
104104
if (challenge.Thumbnail == null)
105105
{
106106
MapThumbnail = new BitmapImage(new Uri(Environment.CurrentDirectory + "\\Data\\UIIcons\\NoThumbnail.png"));

0 commit comments

Comments
 (0)