i think you need to move the check for allowEmptyItems into the catch. even if you allow empty items, you still want a link if there is a content that can be linked.