Fix NPE revealed by updated testing method

This commit is contained in:
Sam Harwell 2013-04-04 13:07:43 -05:00
parent 805430177c
commit 7235d71cc0
1 changed files with 1 additions and 1 deletions

View File

@ -527,7 +527,7 @@ public class Tool {
/** Manually get option node from tree; return null if no defined. */
public static GrammarAST findOptionValueAST(GrammarRootAST root, String option) {
GrammarAST options = (GrammarAST)root.getFirstChildWithType(ANTLRParser.OPTIONS);
if ( options!=null ) {
if ( options!=null && options.getChildCount() > 0 ) {
for (Object o : options.getChildren()) {
GrammarAST c = (GrammarAST)o;
if ( c.getType() == ANTLRParser.ASSIGN &&