Skip to content

Commit

Permalink
Merge pull request #562 from turkeylurkey/issue-561
Browse files Browse the repository at this point in the history
Check if an object is a LibertyModuleNode before trying to cast it.
  • Loading branch information
turkeylurkey authored Nov 6, 2023
2 parents 14c7fcc + 5a99786 commit d70cf24
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/main/java/io/openliberty/tools/intellij/LibertyExplorer.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,15 @@ public Component getTreeCellRendererComponent(
}

// select icon for node based on project type
LibertyModuleNode moduleNode = (LibertyModuleNode) value;
if (moduleNode.isGradleProjectType()) {
setIcon(LibertyPluginIcons.gradleIcon);
} else if (moduleNode.isMavenProjectType()) {
setIcon(LibertyPluginIcons.mavenIcon);
} else {
setIcon(LibertyPluginIcons.libertyIcon);
if (value instanceof LibertyModuleNode) {
LibertyModuleNode moduleNode = (LibertyModuleNode) value;
if (moduleNode.isGradleProjectType()) {
setIcon(LibertyPluginIcons.gradleIcon);
} else if (moduleNode.isMavenProjectType()) {
setIcon(LibertyPluginIcons.mavenIcon);
} else {
setIcon(LibertyPluginIcons.libertyIcon);
}
}

return this;
Expand Down

0 comments on commit d70cf24

Please sign in to comment.