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

Fix missing Exception throw on loading config #123

Merged
merged 4 commits into from
Nov 20, 2023

Conversation

andistorm
Copy link
Contributor

In case of loading a broken config.yaml the function load_yaml returns a nullptr. This fix avoid accessing non-existing elements on a nullptr.

@hikinggrass
Copy link
Contributor

Could we move this check into load_yaml itself? @a-w50 we're using load_yaml in quite a few places in the code and I don't see any usage that would rely on returning a nullptr in case of a broken/empty yaml here. Or am I missing something?

lib/runtime.cpp Outdated Show resolved Hide resolved
lib/yaml_loader.cpp Outdated Show resolved Hide resolved
@andistorm andistorm requested a review from a-w50 November 17, 2023 13:45
In case of laoding a broken config.yaml the function load_yaml returns a nullptr.
This fix avoid accessing non-existing elements on a nullptr.

Signed-off-by: Andreas Heinrich <andreas.heinrich@rwth-aachen.de>
Signed-off-by: Andreas Heinrich <andreas.heinrich@rwth-aachen.de>
* Treat null config as empty config
* Check for wrong type, should be json::object

Signed-off-by: Andreas Heinrich <andreas.heinrich@rwth-aachen.de>
Signed-off-by: Andreas Heinrich <andreas.heinrich@rwth-aachen.de>
@a-w50 a-w50 merged commit 80e45a0 into main Nov 20, 2023
3 checks passed
@a-w50 a-w50 deleted the bugfix/loading-broken-config branch November 20, 2023 09:58
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.

3 participants