From: Matt Joiner Date: Mon, 18 Sep 2017 03:41:19 +0000 (+1000) Subject: storage: Don't add empty mmaps to the mmap span X-Git-Tag: v1.0.0~380 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=9e6cdff175ee2904dc945626e207321f883d64d1;p=btrtrc.git storage: Don't add empty mmaps to the mmap span --- diff --git a/storage/mmap.go b/storage/mmap.go index 94603a8c..fec9d117 100644 --- a/storage/mmap.go +++ b/storage/mmap.go @@ -105,7 +105,9 @@ func mMapTorrent(md *metainfo.Info, location string) (mms mmap_span.MMapSpan, er err = fmt.Errorf("file %q: %s", miFile.DisplayPath(md), err) return } - mms.Append(mm) + if mm != nil { + mms.Append(mm) + } } return }