Skip to content

Commit 6815d4c

Browse files
authored
Merge pull request #1066 from PlayEveryWare/fix/achievement-no-stats
fix: If `definition.StatThersholds` is null, don't iterate on it for selectedDescription
2 parents 5b1577e + ce41ab6 commit 6815d4c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Assets/Scripts/StandardSamples/UI/Achievements/UIAchievementsMenu.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,12 @@ void DisplayAchievementDefinition(DefinitionV2 definition)
292292
"Id: {0}\nUnlocked Display Name: {1}\nUnlocked Description: {2}\nLocked Display Name: {3}\nLocked Description: {4}\nHidden: {5}\n",
293293
definition.AchievementId, definition.UnlockedDisplayName, definition.UnlockedDescription, definition.LockedDisplayName, definition.LockedDescription, definition.IsHidden);
294294

295-
foreach (StatThresholds st in definition.StatThresholds)
295+
if (definition.StatThresholds != null)
296296
{
297-
selectedDescription += string.Format("Stat Thresholds: '{0}': {1}\n", st.Name, st.Threshold);
297+
foreach (StatThresholds st in definition.StatThresholds)
298+
{
299+
selectedDescription += string.Format("Stat Thresholds: '{0}': {1}\n", st.Name, st.Threshold);
300+
}
298301
}
299302

300303
definitionsDescription.text = selectedDescription;

0 commit comments

Comments
 (0)