protection from deref'ing undefs

In my keepass file, the groups don't have subgroups,
and some of them have no entries