Fixes #1168 - Protect against an NPE when checking if a collection relationship is required