Skip to content

Commit

Permalink
Check IDs before reversing it.
Browse files Browse the repository at this point in the history
  • Loading branch information
fourdollars committed Jun 23, 2022
1 parent 2df0ac3 commit df88b62
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion in
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,12 @@ esac

case "$0" in
('/opt/resource/check')
mapfile -t reverseIDs < <(sort -u -n <<<"${IDs[*]}")
json=
if [ -n "${IDs[*]}" ]; then
mapfile -t reverseIDs < <(sort -u -n <<<"${IDs[*]}")
else
reverseIDs=()
fi
for id in "${reverseIDs[@]}"; do
if [ -z "$json" ]; then
json=$(cat <<ENDLINE
Expand Down

0 comments on commit df88b62

Please sign in to comment.