mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-10-29 03:34:43 +00:00
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:
parent
20a5264c95
commit
6294835844
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user