Easy Access

Easy Access

2.7k Downloads

Toolbat Icons: NullReference when calling GetApi

Becks723 opened this issue ยท 0 comments

commented

Hello, someone had reported an error to me. When trying to getapi from Toolbar Icons, it says NullReferenceException. (https://smapi.io/log/61ce5105734041a8aa4da78555d0df7d)

Failed loading the per-mod API instance from Toolbar Icons. Integrations with other mods may not work. 
Error: NullReferenceException: Object reference not set to an instance of an object. 
at StardewMods.ToolbarIcons.ModEntry.GetApi(IModInfo mod) in X:\Repos\stardew-mods\ToolbarIcons\ModEntry.cs:line 33 
at StardewModdingAPI.Framework.ModHelpers.ModRegistryHelper.GetApi(String uniqueID) in SMAPI\Framework\ModHelpers\ModRegistryHelper.cs:line 88

I assume it's the container object not been initialized yet when my mod firstly reached OnGameLaunched.
So I think container needs to be inited early in the Entry part, rather than OnGameLaunched.