Handle entries without categories

The abstracted function to get base_category_ids ‘assumed’ the presence
of some categories, not always the case.