Skip to content

Commit e5435e6

Browse files
committed
Fix division by zero on instant leave replays
1 parent c314bfe commit e5435e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sc2reader/factories/plugins/replay.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def APMTracker(replay):
126126
elif event.name == "PlayerLeaveEvent":
127127
player.seconds_played = event.second
128128

129-
if len(player.apm) > 0:
129+
if len(player.apm) > 0 and player.seconds_played > 0:
130130
player.avg_apm = (
131131
sum(player.aps.values()) / float(player.seconds_played) * 60
132132
)

0 commit comments

Comments
 (0)