Check if DataFields exist before foreach'ing them

`dataFields()` can return nothing if for example you only have literal fields (which could be the case if you're hiding some kind of relationship-defining field (`CheckboxSetField()`) until the record is saved).

So just add a safety check to make sure `dataFields()` is returning something useful.

Note that this is for the 3.0 branch only.