Fix NPE when FRAME_IMAGE not found

The FRAME_IMAGE is an app icon and it can be overridden via skin. It's ok that it's not found
This commit is contained in:
Sergey Ponomarev 2025-10-21 11:09:09 +03:00 committed by Guus der Kinderen
parent 20a5264c95
commit 6294835844

View File

@ -203,20 +203,29 @@ public class Default {
// Otherwise, load and add to cache.
try {
final URL imageURL = getURL(imageName);
if (imageURL == null) {
Log.debug(imageName + " not found.");
return null;
}
final ImageIcon icon = new ImageIcon(imageURL);
cache.put(imageName, icon);
return icon;
}
catch (Exception e) {
Log.warning(imageName + " not found.", e);
Log.warning("Unable to load " + imageName, e);
}
return null;
}
public static URL getURL(String propertyName) {
URL pluginUrl = PluginRes.getDefaultURL(propertyName);
return pluginUrl != null ? pluginUrl : cl.getResource(getString(propertyName));
if (pluginUrl != null) return pluginUrl;
String resourceName = getString(propertyName);
if (resourceName == null) {
return null;
}
return cl.getResource(resourceName);
}