Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
catch exception when attempting to update the snippet tool
Browse files Browse the repository at this point in the history
  • Loading branch information
juli1 committed Sep 13, 2022
1 parent 26a3f78 commit e4ae2a0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pluginGroup=codiga.io.plugins
pluginName=codiga-jetbrains-plugin
pluginVersion=1.7.11
pluginVersion=1.7.12
pluginSinceBuild=213
pluginUntilBuild=222.*
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,19 +195,23 @@ public void beforeAction(Object context) {
@Override
public void afterAction(Object context) {
updateUser();
FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
if (fileEditorManager == null) {
return;
}
FileEditor fileEditor = fileEditorManager.getSelectedEditor();
if (fileEditor == null) {
return;
}
VirtualFile virtualFile = fileEditor.getFile();
if (virtualFile == null) {
return;
try {
FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
if (fileEditorManager == null) {
return;
}
FileEditor fileEditor = fileEditorManager.getSelectedEditor();
if (fileEditor == null) {
return;
}
VirtualFile virtualFile = fileEditor.getFile();
if (virtualFile == null) {
return;
}
updateEditor(project, virtualFile, Optional.empty(), true);
} catch (AlreadyDisposedException alreadyDisposedException) {
LOGGER.error("Cannot update snippet view", alreadyDisposedException);
}
updateEditor(project, virtualFile, Optional.empty(), true);
}
});

Expand Down

0 comments on commit e4ae2a0

Please sign in to comment.