Fixes #6845 - Fix undefined method 'puppet_env' for nil