Fixes #6256 - Handle a nil value in kt_env for hostgroups

Seems to work for me locally...