do not write object when there is no object :)

Change-Id: Ic60ae407ff35b2964bfd3a50af0eff0615e80b03