Merge pull request #300 from garbled1/infinite_loop_bad

Fix a potential infinite loop condition
This commit is contained in:
Tobias Gruetzmacher 2024-02-16 18:13:07 +01:00 committed by GitHub
commit e2b3beac2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -61,7 +61,10 @@ def create_symlinks(d):
else:
order.extend(data["pages"][work]["images"].values())
if "prev" in data["pages"][work]:
work = data["pages"][work]["prev"]
if data["pages"][work]["prev"] == work:
work = None
else:
work = data["pages"][work]["prev"]
else:
work = None
order.reverse()