Permalink
Browse files

Merge pull request #20 from StyleShare/fix-totaltime

Fix an error raised when some node data are empty.
  • Loading branch information...
2 parents 7637864 + 7574c90 commit a01c32ccc7af30a598b867691d47ba32e0e48347 @amcfague committed Jan 18, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 linesman/middleware.py
View
@@ -413,6 +413,11 @@ def prepare_graph(source_graph, cutoff_time, break_cycles=False):
# Always use a copy for destructive changes
graph = source_graph.copy()
+ # Some node data could be empty dict
+ for node, data in graph.nodes(data=True):
+ if not data:
+ data['totaltime'] = 0
+
max_totaltime = max(data['totaltime']
for node, data in graph.nodes(data=True))
for node, data in graph.nodes(data=True):

0 comments on commit a01c32c

Please sign in to comment.