diff --git a/.gitlab-ci/setup-test-env.sh b/.gitlab-ci/setup-test-env.sh index a150bcaff92..dfce99ef3ea 100644 --- a/.gitlab-ci/setup-test-env.sh +++ b/.gitlab-ci/setup-test-env.sh @@ -31,7 +31,9 @@ function error { RED="\e[0;31m" ENDCOLOR="\e[0m" # we force the following to be not in a section - _section_end $CURRENT_SECTION + if [ -n "${CURRENT_SECTION:-}" ]; then + _section_end $CURRENT_SECTION + fi CURR_MINSEC=$(get_current_minsec) echo -e "\n${RED}[${CURR_MINSEC}] ERROR: $*${ENDCOLOR}\n"