Skip to content

Commit e64d4a8

Browse files
fix possible npe
1 parent 92a8254 commit e64d4a8

File tree

1 file changed

+4
-1
lines changed
  • PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-resource-connector-lib/src/main/java/com/microsoft/azure/toolkit/intellij/facet

1 file changed

+4
-1
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-resource-connector-lib/src/main/java/com/microsoft/azure/toolkit/intellij/facet/AzureFacet.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ public static void addTo(@Nonnull final Module module) {
4646
final PropertiesComponent properties = PropertiesComponent.getInstance(module.getProject());
4747
FacetManager.getInstance(module).addFacet(AzureFacetType.INSTANCE, "Azure", null);
4848
properties.setValue(getFacetFlag(module), true);
49-
Optional.ofNullable(ProjectView.getInstance(module.getProject())).ifPresent(v -> v.getCurrentProjectViewPane().updateFromRoot(true));
49+
Optional.of(module.getProject())
50+
.map(ProjectView::getInstance)
51+
.map(ProjectView::getCurrentProjectViewPane)
52+
.ifPresent(p -> p.updateFromRoot(true));
5053
}
5154
}
5255

0 commit comments

Comments
 (0)