]> Sergey Matveev's repositories - btrtrc.git/commitdiff
storage: Don't add empty mmaps to the mmap span
authorMatt Joiner <anacrolix@gmail.com>
Mon, 18 Sep 2017 03:41:19 +0000 (13:41 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 18 Sep 2017 03:41:19 +0000 (13:41 +1000)
storage/mmap.go

index 94603a8c436110ca6b56ff0700f481019b18d6d8..fec9d117495dbbf6cb8a5b6f4fee8fdc9157567f 100644 (file)
@@ -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
 }