fix: Check if event exists before closing it [backport/v4-fix]

Backport of !4688 (merged)


Merge request reports

Loading