Added new condition to avoid problems with empty reference field
Merge pull request #71 from ThomasBesselmann/patch-1

Added new condition to avoid problems with empty reference field