Fix Crash if Environment Null