Fix NullPointerException in case package-info.java #326

This commit is contained in:
maxvetrenko 2014-10-22 18:12:41 +04:00 committed by Roman Ivanov
parent 5650fc1fcd
commit 371c73fe60
1 changed files with 6 additions and 3 deletions

View File

@ -166,10 +166,13 @@ public class AtclauseOrderCheck extends AbstractJavadocCheck
*/
private int getParentType(DetailAST aCommentBlock)
{
int type = 0;
final DetailAST parentNode = aCommentBlock.getParent();
int type = parentNode.getType();
if (type == TokenTypes.TYPE || type == TokenTypes.MODIFIERS) {
type = parentNode.getParent().getType();
if (parentNode != null) {
type = parentNode.getType();
if (type == TokenTypes.TYPE || type == TokenTypes.MODIFIERS) {
type = parentNode.getParent().getType();
}
}
return type;
}