From feafd7460fa7929f10fbbee9fab873e1e667cc7d Mon Sep 17 00:00:00 2001 From: bastimeyer Date: Wed, 25 May 2022 20:57:27 +0200 Subject: [PATCH] fix: error when querying unmodded servers --- dayz-launcher.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dayz-launcher.sh b/dayz-launcher.sh index b3cab95..02fd53f 100755 --- a/dayz-launcher.sh +++ b/dayz-launcher.sh @@ -231,7 +231,8 @@ query_server_api() { debug "Querying ${query}" response="$(curl "${API_PARAMS[@]}" "${query}")" debug "Parsing API response" - jq -e ".result.mods[]" >/dev/null 2>&1 <<< "${response}" || err "Missing mods data from API response" + jq -e '.result.mods | select(type == "array")' >/dev/null 2>&1 <<< "${response}" || err "Missing mods data from API response" + jq -e '.result.mods[]' >/dev/null 2>&1 <<< "${response}" || { msg "This server is unmodded"; return; } INPUT+=( $(jq -r ".result.mods[] | .steamWorkshopId" <<< "${response}") ) }