Fix devision by zero, fixes #413

This commit is contained in:
boltgolt 2020-08-07 14:58:50 +02:00
parent 8abe3c3eeb
commit 5346890287
No known key found for this signature in database
GPG key ID: BECEC9937E1AAE26

View file

@ -176,7 +176,7 @@ while True:
if dark_tries == valid_frames:
print("All frames were too dark, please check dark_threshold in config")
print("Average darkness: " + str(dark_running_total / valid_frames) + ", Threshold: " + str(dark_threshold))
print("Average darkness: " + str(dark_running_total / max(1, valid_frames)) + ", Threshold: " + str(dark_threshold))
sys.exit(13)
else:
sys.exit(11)