checking for undefined
Merge pull request #758 from Connexions/fixing-publishing-error

checking for undefined