diff --git a/cutt/analysis.py b/cutt/analysis.py index 3b27240..f5524ae 100644 --- a/cutt/analysis.py +++ b/cutt/analysis.py @@ -146,6 +146,8 @@ def graph_json( for c in session.exec(statement2): user = player_map[c.user] for i, p_id in enumerate(c.love): + if p_id not in player_map: + continue p = player_map[p_id] edges.append( { @@ -161,6 +163,8 @@ def graph_json( } ) for p_id in c.hate: + if p_id not in player_map: + continue p = player_map[p_id] edges.append( { @@ -335,6 +339,8 @@ def mvp( ) for r in session.exec(statement2): for i, p_id in enumerate(r.mvps): + if p_id not in player_map: + continue p = player_map[p_id] ranks[p] = ranks.get(p, []) + [i + 1]