[Core] Add check for session being NULL so that we don't crash from console commands