Groovy: method return type text can be null

This commit is contained in:
Max Medvedev
2013-03-14 09:24:31 +04:00
parent 3a75e8e5ba
commit c074960037
@@ -132,10 +132,17 @@ public abstract class GrMethodBaseImpl extends GrStubElementBase<GrMethodStub> i
return getParameterList().getParameters();
}
@Nullable
public GrTypeElement getReturnTypeElementGroovy() {
final GrMethodStub stub = getStub();
if (stub != null) {
return GroovyPsiElementFactory.getInstance(getProject()).createTypeElement(stub.getTypeText(), this);
final String typeText = stub.getTypeText();
if (typeText != null) {
return GroovyPsiElementFactory.getInstance(getProject()).createTypeElement(typeText, this);
}
else {
return null;
}
}
return (GrTypeElement)findChildByType(GroovyElementTypes.TYPE_ELEMENTS);