From 72a087fa907287e1a48ace6a378ab9c85de593f6 Mon Sep 17 00:00:00 2001 From: cadon Date: Sun, 4 Feb 2024 17:20:35 +0100 Subject: [PATCH] fix null exceptions if no stat weights are set --- ARKBreedingStats/Form1.library.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ARKBreedingStats/Form1.library.cs b/ARKBreedingStats/Form1.library.cs index dd1f331a..9fc5029a 100644 --- a/ARKBreedingStats/Form1.library.cs +++ b/ARKBreedingStats/Form1.library.cs @@ -319,7 +319,7 @@ private void CalculateTopStats(List creatures) var statPreferences = new StatWeighting.StatValuePreference[Stats.StatsCount]; for (int s = 0; s < Stats.StatsCount; s++) { - var statWeight = statWeights.Item1[s]; + var statWeight = statWeights.Item1?[s] ?? 1; statPreferences[s] = statWeight > 0 ? StatWeighting.StatValuePreference.High : statWeight < 0 ? StatWeighting.StatValuePreference.Low : StatWeighting.StatValuePreference.Indifferent;