EnhancedStreamChat-v3
EnhancedStreamChat-v3 copied to clipboard
NullPointerException in ChatDisplay.CreateChatFont
I'm trying to set up a couple of mods on Linux and, while frustrating at times, I'm slowly getting there. Unfortunately, I don't see the chat panel appear within the game. The only lead I have is the following exception I found in the Player.log
:
NullReferenceException: Object reference not set to an instance of an object
at EnhancedStreamChat.Chat.ChatDisplay.CreateChatFont () [0x00044] in <2c34ceafdb374588a3c38ab06a427a12>:0
at EnhancedStreamChat.Chat.ChatDisplay.Awake () [0x00016] in <2c34ceafdb374588a3c38ab06a427a12>:0
UnityEngine.GameObject:Internal_AddComponentWithType(Type)
UnityEngine.GameObject:AddComponent(Type)
UnityEngine.GameObject:AddComponent()
BeatSaberMarkupLanguage.BeatSaberUI:CreateViewController()
EnhancedStreamChat.Chat.ChatManager:BSEvents_menuSceneLoadedFresh()
[...]
Could the error occur on this line, when the font can't be found? I've tried both the default "Segoe UI" (which I don't think is present on my system) as well as "DejaVu Sans" as the SystemFontName
in the config.
"Arial" seems to be a font that is able to be picked up, so in the event that neither the chosen font nor "Segoe UI" are available, you could fall back to that.
if (!FontManager.TryGetTMPFontByFamily(fontName, out font))
{
if (FontManager.TryGetTMPFontByFamily("Segoe UI", out font))
Logger.log.Error($"Could not find font {fontName}! Falling back to Segoe UI");
else if (FontManager.TryGetTMPFontByFamily("Arial", out font))
Logger.log.Error($"Could not find font {fontName}! Falling back to Arial");
else
throw new Exception($"Could not find font {fontName} or fallback fonts Segoe UI or Arial");
}
Thanks for the feedback, will address this before full release.