Fix division by zero in progress indicator

- Add check for total=0 before calculating percentage
- Prevents crash when indexing empty user/database lists
- Displays 100% completion for empty lists

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
cschantz
2025-11-19 16:44:24 -05:00
parent bad789b66c
commit 2d4a6ff88b
+7
View File
@@ -117,6 +117,13 @@ show_progress() {
local current=$1
local total=$2
local message="$3"
# Avoid division by zero
if [ "$total" -eq 0 ]; then
printf "\r[INFO] Progress: [####################] 100%% - %s" "$message"
return
fi
local percent=$((current * 100 / total))
local bars=$((percent / 5)) # 20 chars wide