Fix uncaught exception when publishing nested items.