add nullptr check
This commit is contained in:
parent
7b06987335
commit
c9a51b98ae
|
@ -126,7 +126,7 @@ public class GrammarAST extends CommonTree {
|
|||
}
|
||||
|
||||
public GrammarAST getNodeWithTokenIndex(int index) {
|
||||
if ( this.getToken().getTokenIndex()==index ) {
|
||||
if ( this.getToken()!=null && this.getToken().getTokenIndex()==index ) {
|
||||
return this;
|
||||
}
|
||||
// walk all children of root.
|
||||
|
|
Loading…
Reference in New Issue