Skip to content

Commit ac1767a

Browse files
Merge pull request #6908 from microsoft/august-issues
Resolve issues reported in august release
2 parents 62aa880 + 16bbf75 commit ac1767a

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-appservice/src/main/java/com/microsoft/azure/toolkit/intellij/legacy/function/runner/FunctionRunConfigurationProducer.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,17 @@ public boolean isConfigurationFromContext(AzureRunConfigurationBase appConfigura
101101
}
102102

103103
private static Location<PsiMethod> getAzureFunctionMethods(final Location<?> location) {
104-
for (Iterator<Location<PsiMethod>> iterator = location.getAncestors(PsiMethod.class, false); iterator.hasNext();) {
105-
final Location<PsiMethod> methodLocation = iterator.next();
106-
if (FunctionUtils.isFunctionClassAnnotated(methodLocation.getPsiElement())) {
107-
return methodLocation;
104+
try {
105+
for (Iterator<Location<PsiMethod>> iterator = location.getAncestors(PsiMethod.class, false); iterator.hasNext(); ) {
106+
final Location<PsiMethod> methodLocation = iterator.next();
107+
if (FunctionUtils.isFunctionClassAnnotated(methodLocation.getPsiElement())) {
108+
return methodLocation;
109+
}
108110
}
111+
return null;
112+
} catch (Throwable e) {
113+
return null;
109114
}
110-
return null;
111115
}
112116

113117
private Module findModule(FunctionRunConfiguration configuration, Module contextModule) {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public synchronized void takeSurvey(@Nonnull final Project project, final ICusto
7474
}
7575

7676
private void showSurveyPopup(final @Nonnull Project project, final ICustomerSurvey survey) {
77+
if (project.isDisposed()) {
78+
return;
79+
}
7780
final SurveyPopUpDialog popUpDialog = new SurveyPopUpDialog(project, survey, response -> {
7881
try {
7982
if (response == CustomerSurveyResponse.ACCEPT) {

PluginsAndFeatures/azure-toolkit-for-intellij/src/main/java/com/microsoft/azure/toolkit/intellij/function/CreateFunctionAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ protected PsiElement[] create(@NotNull String s, PsiDirectory psiDirectory) thro
158158
@Override
159159
protected boolean isAvailable(final DataContext dataContext) {
160160
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
161-
if (project == null) {
161+
if (project == null || project.isDisposed()) {
162162
return false;
163163
}
164164
final IdeView view = LangDataKeys.IDE_VIEW.getData(dataContext);

0 commit comments

Comments
 (0)