Commenting out these 2 lines fixed the crash. However, the Unreal Engine menu no longer works. Acceptable workaround for me.