Fix exception when this.data() returns undefined

Was throwing an exception in the CMS (running 3.1.1) looks like this.data() returned undefined where the data attribute didn't exist.