Fix processing of empty add-on config (#91)

This commit is contained in:
Franck Nijhof 2021-11-10 11:39:31 +01:00 committed by GitHub
parent 4d2fa76db6
commit 69608c0d12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -562,6 +562,14 @@ function bashio::addon.config() {
response=$(bashio::api.supervisor GET "/addons/self/options/config" false)
# If the add-on has no configuration, it returns an empty string.
# This is Bashio logic, that is problematic in this case, so make it a
# emtpty JSON object instead.
if bashio::var.is_empty "${response}";
then
response="{}"
fi
bashio::cache.set "${cache_key}" "${response}"
printf "%s" "${response}"