MDL-40924 badges: added a print_error when no badges are found to avoid notices