Skip to content

Commit a0a1b4c

Browse files
committed
Resolve possible NPE in IntelliJAzureIcons in high constrast theme
1 parent e7ca310 commit a0a1b4c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/IntelliJAzureIcons.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,13 @@ private static Icon getFileTypeIcon(final String name) {
105105

106106
@Nullable
107107
private static Icon loadIcon(String iconPathOrName, Class<?> clazz) {
108+
if (StringUtils.isBlank(iconPathOrName)) {
109+
return null;
110+
}
108111
try {
109112
final Icon result = IconLoader.getIcon(iconPathOrName, clazz);
110113
return result.getIconHeight() > 1 ? result : null; // IconLoader may return dot for non-existing icon
111-
} catch (final RuntimeException ise) {
114+
} catch (final Throwable ise) {
112115
return null;
113116
}
114117
}

0 commit comments

Comments
 (0)