fix: guard against division by zero when fetchBytes is 0 (closes #5) #10

Merged
sneak merged 1 commits from fix/issue-5 into main 2026-02-09 01:05:25 +01:00

1 Commits

Author SHA1 Message Date
clawbot
79ceed2ee4 fix: guard against division by zero when fetchBytes is 0
processAndStore() computed sizePercent as outputSize/fetchBytes*100
without checking for zero, producing Inf/NaN in logs and metrics.

Also treat empty cached source data the same as missing (re-fetch
from upstream) since zero-byte images can't be processed.

Fixes #5
2026-02-08 15:59:51 -08:00