From 8a55e33a00b43b9ba33a370eb0bd62fe68c3d235 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Sat, 3 Jan 2026 14:06:29 +0800 Subject: [PATCH] refactor: ensure mail cleaning configuration variables default to empty if unset. --- lib/clean/user.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/clean/user.sh b/lib/clean/user.sh index 26fe25d..5f7a096 100644 --- a/lib/clean/user.sh +++ b/lib/clean/user.sh @@ -401,7 +401,7 @@ clean_recent_items() { } clean_mail_downloads() { stop_section_spinner - local mail_age_days=$MOLE_MAIL_AGE_DAYS + local mail_age_days=${MOLE_MAIL_AGE_DAYS:-} if ! [[ "$mail_age_days" =~ ^[0-9]+$ ]]; then mail_age_days=30 fi @@ -418,7 +418,7 @@ clean_mail_downloads() { if ! [[ "$dir_size_kb" =~ ^[0-9]+$ ]]; then dir_size_kb=0 fi - local min_kb="$MOLE_MAIL_DOWNLOADS_MIN_KB" + local min_kb="${MOLE_MAIL_DOWNLOADS_MIN_KB:-}" if ! [[ "$min_kb" =~ ^[0-9]+$ ]]; then min_kb=5120 fi