Skip to content

Commit a32d0c1

Browse files
fix possible npe, #7677
1 parent ae9629a commit a32d0c1

File tree

1 file changed

+2
-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

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import javax.annotation.Nonnull;
1212
import javax.swing.*;
13+
import java.util.Optional;
1314

1415
public class AzureFacetEditorPanel {
1516
@Nonnull
@@ -39,7 +40,7 @@ private void createUIComponents() {
3940
this.dotAzureDirInput = new TextFieldWithBrowseButton(new JTextField());
4041
final FileChooserDescriptor descriptor = new FileChooserDescriptor(false, true, false, false, false, false)
4142
.withFileFilter(file -> file.isDirectory() && file.findChild("profiles.xml") != null);
42-
descriptor.setRoots(ProjectUtil.guessModuleDir(this.module));
43+
Optional.ofNullable(ProjectUtil.guessModuleDir(this.module)).ifPresent(descriptor::setRoots);
4344
this.dotAzureDirInput.setEditable(false);
4445
this.dotAzureDirInput.setEnabled(false);
4546
// noinspection DialogTitleCapitalization

0 commit comments

Comments
 (0)