Fix null exceptions

This commit is contained in:
D1GQ committed 2026-08-27 17:00:02 -05:00
1 parent 5e5a1c9cd1
commit 3b66d90183
2 files changed
+18 -8

No files matched your search

@@ -114,14 +114,24 @@ internal static class FindAGameManagerPatch
Transform child = container.transform.Find("Container");
Transform tmproObject = child.Find("TrueHostName_TMP");
// Use existing TMP component or create new one
TMP_Text tmpro = tmproObject != null
? tmproObject.GetComponent<TextMeshPro>()
: CreateNewTextMeshPro(child);
TMP_Text? tmpro = null;
tmpro.font = container.capacity.font;
tmpro.fontSize = 3f;
tmpro.text = FormatGameInfoText(container.gameListing);
if (tmproObject != null)
{
tmpro = tmproObject.GetComponent<TextMeshPro>();
}
if (tmpro == null)
{
tmpro = CreateNewTextMeshPro(child);
}
if (tmpro != null)
{
tmpro.font = container.capacity?.font;
tmpro.fontSize = 3f;
tmpro.text = FormatGameInfoText(container.gameListing);
}
}
}
+1 -1
View File
@@ -80,7 +80,7 @@ internal static class RoleUtils
return color;
}
return string.Empty;
return "#ffffff";
}
/// <summary>