Why does accessing Game Instance = crash

Hi,

I’m using 4.8.3 and in my case I added the “GetGameInstance()” into a class constructor (dumb move), the code compiled fine and the editor stopped running and when it crashed it said nothing about the error not even the .log files had anything of use there.

I had to remove all my latest code and gradually adding it back in (a day of work in that).

Just wanted to add this to the thread as the behaviour of not showing any error nor logging the null pointer exception? or something like it shouldn’t be considered a bug?
Can anyone else validate that the crash dump doesn’t indeed say anything?

To reproduce just:
Add an AActor subclass;
In the constructor just add the GetGameInstance() into a local or class variable (it does the same).
Compile and launch the editor.

Thank you for the time and hopefully I’ve helped ironing a tiny bit of the engine! Or just be clueless at what I’m doing :stuck_out_tongue:

1 Like