GROOVY-6633: In each JsonOutput.toJson method added check for null