don't let as_operations run amok

This commit is contained in:
Laura Klünder 2024-12-13 11:25:10 +00:00
parent b69b70fbad
commit 14b8bca34a

View file

@ -576,7 +576,13 @@ class ChangedObjectCollection(BaseSchema):
# nothing to do? then we're done # nothing to do? then we're done
done_situation = start_situation done_situation = start_situation
num = 0
while open_situations and not done_situation: while open_situations and not done_situation:
num += 1
if num > 1000:
raise ValueError("as_operations might be in an endless loop")
situation = open_situations.pop(0) situation = open_situations.pop(0)
continued = False continued = False