add try catch

This commit is contained in:
林万程
2023-06-13 07:45:15 +08:00
parent 2c6f96712b
commit 83e0a0a5ee
13 changed files with 138 additions and 20 deletions

View File

@@ -28,6 +28,15 @@ public class CopyReferenceSimple extends CopyReferenceAction {
@Nullable
@Override
protected String getQualifiedName(@NotNull Editor editor, List elements) {
try {
return simpleName(editor, elements);
} catch (Exception e) {
return e.toString();
}
}
@Nullable
private String simpleName(@NotNull Editor editor, List elements) {
// because 2nd param is List<PsiElement> in 2020.1 and List<? extends PsiElement> in new version
//noinspection unchecked
String qualifiedName = super.getQualifiedName(editor, elements);