mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-19 15:51:52 +00:00
Fix null exceptions
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ internal static class RoleUtils
|
||||
return color;
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
return "#ffffff";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user