SWC-1301: only set if not null
Merge pull request #911 from jay-hodgson/release-38

SWC-1301: only set if not null