From 6dcb938ad531669b4e59f9b840ceb55f60080409 Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Sat, 4 Mar 2023 13:29:58 +0000 Subject: [PATCH] Don't break if we find a null script in FontReplacer --- QSB/PlayerBodySetup/Remote/FontReplacer.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/QSB/PlayerBodySetup/Remote/FontReplacer.cs b/QSB/PlayerBodySetup/Remote/FontReplacer.cs index bf974239..d721e1ca 100644 --- a/QSB/PlayerBodySetup/Remote/FontReplacer.cs +++ b/QSB/PlayerBodySetup/Remote/FontReplacer.cs @@ -13,6 +13,12 @@ public static class FontReplacer foreach (var monoBehaviour in prefab.GetComponentsInChildren(true)) { + if (monoBehaviour == null) + { + DebugLog.ToConsole($"Null monobehaviour found on {prefab.name}!", OWML.Common.MessageType.Warning); + continue; + } + var publicFields = monoBehaviour .GetType() .GetFields(BindingFlags.Public | BindingFlags.Instance);