unclecheese/silverstripe-gridfield-betterbuttons — pull request #41 by trev (2013-11-14 03:17:08+00:00)
Title: 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 your some kind of relationship defining field 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.