prevent NPE on old skin/theme

This commit is contained in:
Anthony Calosa
2024-12-05 21:00:39 +08:00
parent b858b48fde
commit ebffb83932

View File

@@ -760,7 +760,13 @@ public class FSkin {
public static SkinIcon getIcon(final FSkinProp s0) {
final SkinIcon icon = SkinIcon.icons.get(s0);
if (icon == null) {
final SkinIcon blank = SkinIcon.icons.get(FSkinProp.ICO_BLANK);
if (blank == null) // if blank is null at this point then the skin is bugged or GC?
throw new NullPointerException("Can't find an icon for FSkinProp " + s0);
else { // this should be 2 or less unless a new required image icon is needed.
System.err.println("Missing image icon for FSkinProp " + s0 + ". Blank image will be used instead.");
return blank;
}
}
return icon;
}