From 9ae8e2e0e9d8e5a08b405c47a5cb9e4983f2a9e5 Mon Sep 17 00:00:00 2001 From: edbmods Date: Tue, 27 Dec 2022 17:08:00 -0800 Subject: [PATCH] Added null pointer check to pawn provider. Removed logging statement. --- Source/ProviderPawnKinds.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/ProviderPawnKinds.cs b/Source/ProviderPawnKinds.cs index 6b6053b..445fd65 100644 --- a/Source/ProviderPawnKinds.cs +++ b/Source/ProviderPawnKinds.cs @@ -85,7 +85,7 @@ public ProviderPawnKinds() { foreach (var pair in uniquePawnKindsByFaction) { var faction = pair.Key; var pawnKinds = new List(pair.Value); - Logger.Debug("Sorting unique pawns kinds by faction: " + faction?.defName); + //Logger.Debug("Sorting unique pawns kinds by faction: " + faction?.defName); pawnKinds.Sort((a, b) => { return string.Compare(a.LabelCap.ToString(), b.LabelCap.ToString()); }); @@ -98,7 +98,7 @@ public ProviderPawnKinds() { } pawnKindsByFaction.Sort((a, b) => { - return string.Compare(a.Faction.LabelCap.ToString(), b.Faction.LabelCap.ToString()); + return string.Compare(a.Faction?.LabelCap.ToString(), b.Faction?.LabelCap.ToString()); }); otherPawnKinds.Sort((a, b) => { return string.Compare(a.LabelCap.ToString(), b.LabelCap.ToString());