diff --git a/python/Round.py b/python/Round.py index 312e0c1..63ff6b7 100644 --- a/python/Round.py +++ b/python/Round.py @@ -16,6 +16,9 @@ class Round: def __init__(self, winnerTeam, loserTeam, _map, duration, startTime, winnerSide): + if duration <= 0: + raise ValueError("Duration cannot be zero") + self.winners = winnerTeam self.losers = loserTeam self.winnerSide = winnerSide diff --git a/python/backends/eventStream.py b/python/backends/eventStream.py index f91816e..b6b83ef 100644 --- a/python/backends/eventStream.py +++ b/python/backends/eventStream.py @@ -170,6 +170,10 @@ class EventSeries(): elif type(e) == MapInformationEvent: self.map = e.map + ### check if there are players in both teams ### + if not self.winnerTeam or not self.loserTeam: + raise ValueError("One of the teams was empty") + ### normalize teamchanges toBeRemovedFromLosers = [] # cannot change iteable during iteration toBeRemovedFromWinners = []