Skip to content

Commit

Permalink
Minor fix in JetNamedFunction
Browse files Browse the repository at this point in the history
This caused NullPointerException while running JetParsingTest when I changed some test.
  • Loading branch information
wlopata committed Feb 27, 2013
1 parent a3eae3d commit 6020fc2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.jetbrains.jet.lang.psi.stubs.PsiJetFunctionStub;
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
import org.jetbrains.jet.lang.resolve.name.FqName;
import org.jetbrains.jet.lang.resolve.name.Name;
import org.jetbrains.jet.lexer.JetTokens;

import java.util.Collections;
Expand Down Expand Up @@ -83,7 +84,7 @@ public JetExpression getInitializer() {

/**
* Returns full qualified name for function "package_fqn.function_name"
* Not null for top level functions.
* Not null for top level functions unless syntax errors are present.
* @return
*/
@Nullable
Expand All @@ -101,7 +102,10 @@ public FqName getFqName() {
}
JetFile jetFile = (JetFile) parent;
final FqName fileFQN = JetPsiUtil.getFQName(jetFile);
return fileFQN.child(getNameAsName());
Name nameAsName = getNameAsName();
if (nameAsName != null) {
return fileFQN.child(nameAsName);
}
}

return null;
Expand Down

0 comments on commit 6020fc2

Please sign in to comment.