fix for GRAILS-10402 "NullPointerException in Restful resource"