Skip to content

Commit 0c74a8f

Browse files
fix possible npe, Get java.lang.IllegalArgumentException one time. AB#2078643
1 parent 619ad2c commit 0c74a8f

File tree

1 file changed

+4
-2
lines changed
  • PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-lib/src/main/java/com/microsoft/azure/toolkit/intellij/common/auth

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ public AzureSignInAction(@Nullable String title) {
5959
}
6060

6161
public boolean onActionPerformed(@NotNull AnActionEvent e, @Nullable Operation operation) {
62-
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
63-
authActionPerformed(project);
62+
final Project project = e.getProject();
63+
if (Objects.nonNull(project)) {
64+
authActionPerformed(project);
65+
}
6466
return true;
6567
}
6668

0 commit comments

Comments
 (0)