Fix DEBUG-mode segfault

When using the new "call dof_indices with elem=NULL" behavior,
dof_indices really can't dereference elem...