avoid NULL pointer dereferences
LAMMPS may not have allocated per-atom arrays when no atom has yet been present in a subdomain. catch this case and return early.