ResoniteModdingGroup / MonkeyLoader.GamePacks.ResoniteModLoader

MonkeyLoader Game Pack that provides compatibility for ResoniteModLoader.
GNU Lesser General Public License v3.0
5 stars 1 forks source link

Crash on startup from DevCreateNewForm #1

Closed Nytra closed 2 months ago

Nytra commented 2 months ago

Try loading Component Search Wizard

System.TypeInitializationException: The type initializer for 'FrooxEngine.DevCreateNewForm' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object

DeselectOwnGizmos also gives a similar error.

Log file:

DESKTOP-H976HO2 - 2024.4.26.1258 - 2024-04-28 21_44_17.log

Banane9 commented 2 months ago

That's curious, as the Component Search Wizard worked fine for me 🤔

Banane9 commented 2 months ago

Can you try without DeselectOwnGizmos?

Nytra commented 2 months ago

It works without DeselectOwnGizmos

Banane9 commented 2 months ago

mmmm, right, I think I figured it out. I didn't pay attention while postfixing EngineInitializer.InitializeFrooxEngine. It returns a Task, so postfixing the method makes it actually run before the code in the method has run. Which just so happens to also include initializing the component library which DevCreateNew's static constructor accesses.

As far as I can tell, initializing the component library happens concurrent with RML being invoked anyways, so that this ever consistently worked is somewhat surprising. Although there is this issue, I guess - from before I made this integration.