From 4000dbf3584bd20669b296ad40c5f6e63e64b006 Mon Sep 17 00:00:00 2001 From: levasseur Date: Fri, 8 Oct 2021 17:56:08 +0200 Subject: [PATCH] err_exit: better check file existance than variable being set before cleaning up temp file --- lib/aaa_errors.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aaa_errors.sh b/lib/aaa_errors.sh index f350189..13d156e 100644 --- a/lib/aaa_errors.sh +++ b/lib/aaa_errors.sh @@ -72,7 +72,7 @@ trap "error ${LINENO}; backtrace; err_exit" ERR # Exit program in case of error unless keepgoing is set to true function err_exit { - if [[ -n $tmpfile ]]; then + if [[ -f $tmpfile ]]; then rm -f $tmpfile fi if [[ $KEEPGOING != true ]]; then