Skip to content

Commit

Permalink
Log warning when the icon is not found.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonharrer committed Sep 9, 2015
1 parent f2715ea commit 698549d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/net/sf/jabref/gui/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ public class IconTheme {
* @return The URL to the actual image to use.
*/
public static URL getIconUrl(String name) {
String path = KEY_TO_ICON.getOrDefault(Objects.requireNonNull(name, "icon name"), DEFAULT_ICON_PATH);
String key = Objects.requireNonNull(name, "icon name");
if(!KEY_TO_ICON.containsKey(key)) {
LOGGER.warn("could not find icon url by name " + name + ", so falling back on default icon " + DEFAULT_ICON_PATH);
}
String path = KEY_TO_ICON.getOrDefault(key, DEFAULT_ICON_PATH);
return Objects.requireNonNull(IconTheme.class.getResource(path), "url");
}

Expand Down

0 comments on commit 698549d

Please sign in to comment.