How to fix repeated crash when loading Project?

The code may have changed slightly as I’m still trying to see if there’s something I can do from VS