mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 06:51:17 +07:00
[groovy] fix NPE warning in static import method fix
This commit is contained in:
+3
-4
@@ -165,16 +165,15 @@ public class GroovyStaticImportMethodFix extends Intention {
|
||||
private void doImport(final PsiMethod toImport) {
|
||||
CommandProcessor.getInstance().executeCommand(toImport.getProject(), () -> WriteAction.run(() -> {
|
||||
try {
|
||||
GrMethodCall element = myMethodCall.getElement();
|
||||
if (element != null) {
|
||||
getMethodExpression(element).bindToElementViaStaticImport(toImport);
|
||||
GrReferenceExpression expression = getMethodExpression();
|
||||
if (expression != null) {
|
||||
expression.bindToElementViaStaticImport(toImport);
|
||||
}
|
||||
}
|
||||
catch (IncorrectOperationException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
}), getText(), this);
|
||||
|
||||
}
|
||||
|
||||
private void chooseAndImport(Editor editor) {
|
||||
|
||||
Reference in New Issue
Block a user