Fixes badgeBuilder

badgeBuilder otherwise will fail trying to iterate over undefined badges.