Fix stuck loop when building menu with no content