From e26713688b033d1a463b437114cec190ae68dd66 Mon Sep 17 00:00:00 2001 From: RMROC451 Date: Sat, 13 Jul 2024 11:11:22 -0500 Subject: [PATCH] Fix issue with cars that are missing tagcallouts from throwing errors. --- TweaksAndThings/Patches/CarInspector_PopulateCarPanel_Patch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TweaksAndThings/Patches/CarInspector_PopulateCarPanel_Patch.cs b/TweaksAndThings/Patches/CarInspector_PopulateCarPanel_Patch.cs index b88547b..bf70c9d 100644 --- a/TweaksAndThings/Patches/CarInspector_PopulateCarPanel_Patch.cs +++ b/TweaksAndThings/Patches/CarInspector_PopulateCarPanel_Patch.cs @@ -70,7 +70,7 @@ internal class CarInspector_PopulateCarPanel_Patch private static UIPanelBuilder AddCarConsistRebuildObservers(UIPanelBuilder builder, IEnumerable consist) { TagController tagController = UnityEngine.Object.FindFirstObjectByType(); - foreach (Model.Car car in consist) + foreach (Model.Car car in consist.Where(c => c.TagCallout != null)) { builder = AddObserver(builder, car, PropertyChange.KeyForControl(PropertyChange.Control.Handbrake), tagController); foreach (LogicalEnd logicalEnd in ends)