Fix crash when attempting to union a relationship with a `nil` value. fixes #1195