I removed that condition because while writing specs it was returning an extra empty link.  However, after modifying the test models it is behaving as it was originally expected.  I've added the condition back and updated the test example to cover this condition correctly here d12cf9a59124b606c40cd4db4f358278cd259b7b.