Fix devision by zero, fixes #413
This commit is contained in:
parent
8abe3c3eeb
commit
5346890287
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue