Guard around null ast

This can happen in profiling
This commit is contained in:
rocky
2017-11-14 10:58:41 -05:00
parent 669a220762
commit 9a141a3144

View File

@@ -398,7 +398,7 @@ class Python2Parser(PythonParser):
def reduce_is_invalid(self, rule, ast, tokens, first, last):
lhs = rule[0]
if lhs in ('augassign1', 'augassign2') and ast[0][0] == 'and':
if lhs in ('augassign1', 'augassign2') and ast[0] and ast[0][0] == 'and':
return True
elif lhs == '_stmts':
for i, stmt in enumerate(ast):