Add check for parent data when linking to associated item

For example if you have an association to the item "related", and you want to create a link to this item then the route would use the parameter related.id or similar.
This check just ensures that "related" is set in the dataset before retrieving the id.