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

Always return an object when loading a YAML file #20289

Merged
merged 2 commits into from
Dec 20, 2023
Merged

Conversation

rhuss
Copy link
Contributor

@rhuss rhuss commented Dec 19, 2023

If loading an empty file or a file that only contains comments, yaml.load() returns null, which is the cause for #20283. This PR should make loading of YAML file more robust, as I don't think anybody relies on the special behavior of getting a null for an empty file.

@Koenkk
Copy link
Owner

Koenkk commented Dec 19, 2023

Thanks! Could you add a test for this? I think you can reuse this one

@rhuss
Copy link
Contributor Author

rhuss commented Dec 19, 2023

Sure, I've added a test for testing an empty, second device file. Without the fix, the test fails.

@Koenkk Koenkk changed the base branch from master to dev December 20, 2023 18:31
@Koenkk Koenkk enabled auto-merge (squash) December 20, 2023 18:31
@Koenkk
Copy link
Owner

Koenkk commented Dec 20, 2023

Thanks!

@Koenkk Koenkk disabled auto-merge December 20, 2023 18:31
@Koenkk Koenkk merged commit b67888f into Koenkk:dev Dec 20, 2023
11 checks passed
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.

2 participants