Bugfix: Save crashed when reference had emtpy scalar field.

Added check to ensure that the Pointdata defined
on the mesh is not empty.