err_exit: better check file existance than variable being set before cleaning up temp file

This commit is contained in:
levasseur
2021-10-08 17:56:08 +02:00
parent 5324ee0636
commit 4000dbf358

View File

@@ -72,7 +72,7 @@ trap "error ${LINENO}; backtrace; err_exit" ERR
# Exit program in case of error unless keepgoing is set to true # Exit program in case of error unless keepgoing is set to true
function err_exit function err_exit
{ {
if [[ -n $tmpfile ]]; then if [[ -f $tmpfile ]]; then
rm -f $tmpfile rm -f $tmpfile
fi fi
if [[ $KEEPGOING != true ]]; then if [[ $KEEPGOING != true ]]; then