MDL-39480 core_badge: prevented a php notice