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

Change-Id: I4e587316e51eb4f9485624a7e35bfc69ffe3b7e4
This commit is contained in:
Joan Varvenne 2016-09-21 15:22:26 +01:00
parent d543008431
commit 7986ab2466
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