Merge "Fix crash when there's no connection in the banana file."

This commit is contained in:
Jenkins 2016-09-27 12:44:01 +00:00 committed by Gerrit Code Review
commit 1e81849f4f
1 changed files with 7 additions and 0 deletions

View File

@ -41,6 +41,13 @@ def deadpathck(banana_file, type_table, emitter=emit.PrintEmitter()):
# Look first for all branch that are "dead"
connections = banana_file.connections # type: ast.Connection
# If there are no connections everything is considered
# as dead.
if connections is None:
class EmptyConnections(object):
connections = []
connections = EmptyConnections()
# Collect the nodes and connect them.
dag_nodes = {}
# Create all the nodes