Skip to content

Commit

Permalink
Fix processing of empty add-on config (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Nov 10, 2021
1 parent 4d2fa76 commit 69608c0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/addons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down

0 comments on commit 69608c0

Please sign in to comment.