fix get_user_name without werarning medal

This commit is contained in:
xiaomlove
2022-08-25 02:05:34 +08:00
parent 6f8e68ad22
commit bed3bf6448

View File

@@ -3711,7 +3711,7 @@ function get_username($id, $big = false, $link = true, $bold = true, $target = f
//medal
$medalHtml = '';
foreach ($arr['wearing_medals'] as $medal) {
foreach ($arr['wearing_medals'] ?? [] as $medal) {
$medalHtml .= sprintf(
'<img src="%s" title="%s" class="%s preview" style="max-height: %s;max-width: %s;margin-left: %s"/>',
$medal['image_large'], $medal['name'], $medalClass, $medalSize, $medalSize, $marginLeft