json fogMode may be null

This is a better cross-platform fix, the previous fix gave compiler errors on c++ targets.