Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return early in yaml_emitter_close #292

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

perlpunk
Copy link
Member

If yaml_emitter_dump failed, the emitter might be in a broken state and have leftover states/events.
yaml_emitter_close calls yaml_emitter_emit which will try to emit those events, so we should return early.

The recommended thing to do for library users is to abort when yaml_emitter_dump fails, but it's easy to add a check here as well.

@perlpunk
Copy link
Member Author

CI failure addressed by #293

@perlpunk perlpunk force-pushed the check-emitter-error branch 2 times, most recently from e584022 to 635a691 Compare May 7, 2024 14:07
If yaml_emitter_dump failed, the emitter might be in a broken
state and have leftover states/events.
yaml_emitter_close calls yaml_emitter_emit which will
try to emit those events, so we should return early.

The recommended thing to do for library users is to abort
when yaml_emitter_dump fails, but it's easy to add a check
here as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant