summaryrefslogtreecommitdiff
path: root/internal/feed/template
diff options
context:
space:
mode:
Diffstat (limited to 'internal/feed/template')
-rw-r--r--internal/feed/template/template.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/feed/template/template.go b/internal/feed/template/template.go
index 4c7b636..5a30c56 100644
--- a/internal/feed/template/template.go
+++ b/internal/feed/template/template.go
@@ -33,9 +33,12 @@ func lastUrlPart(url string) string {
}
func byteCount(str string) string {
- b, err := strconv.ParseUint(str, 10, 64)
- if err != nil {
- log.Printf("Cannot convert '%s' to byte count: %s", str, err)
+ var b uint64
+ if str != "" {
+ var err error
+ if b, err = strconv.ParseUint(str, 10, 64); err != nil {
+ log.Printf("Cannot convert '%s' to byte count: %s", str, err)
+ }
}
const unit = 1024