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 processing of empty add-on config #91

Merged
merged 1 commit into from
Nov 10, 2021
Merged

Fix processing of empty add-on config #91

merged 1 commit into from
Nov 10, 2021

Conversation

frenck
Copy link
Member

@frenck frenck commented Nov 10, 2021

Proposed Changes

Bashio handles {} as an empty value. This works nicely when working with Bash, as it doesn't handle dictionaries that well.

In the case of fetching the full configuration from the Supervisor API, this may lead to a surprising issue. If there is no add-on configuration, it returns {} is handled as empty by Bashio.

When later processing values from the empty config, jq simply returns empty results 🤷
To prevent these issues, I've added a small check to ensure we return an empty JSON object when there is no add-on configuration.

This makes Bashio behave exactly the same as with the previous options.json method.

@frenck frenck added the bugfix Inconsistencies or issues which will cause a problem for users or implementors. label Nov 10, 2021
@frenck frenck merged commit 69608c0 into main Nov 10, 2021
@frenck frenck deleted the frenck-2021-2861 branch November 10, 2021 10:39
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix Inconsistencies or issues which will cause a problem for users or implementors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant