From 69608c0d12df1f1f23fb309f447af65791cf0c47 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 10 Nov 2021 11:39:31 +0100 Subject: [PATCH] Fix processing of empty add-on config (#91) --- lib/addons.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/addons.sh b/lib/addons.sh index 562b56f..52f6885 100644 --- a/lib/addons.sh +++ b/lib/addons.sh @@ -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}"