diff --git a/server/torr/storage/torrstor/cache.go b/server/torr/storage/torrstor/cache.go index eabcad7..3074b31 100644 --- a/server/torr/storage/torrstor/cache.go +++ b/server/torr/storage/torrstor/cache.go @@ -315,15 +315,14 @@ func (c *Cache) NewReader(file *torrent.File) *Reader { } func (c *Cache) Readers() int { - // TODO проверить - // if c == nil { - // return 0 - // } - if c == nil || c.readers == nil { + if c == nil { return 0 } c.muReaders.Lock() defer c.muReaders.Unlock() + if c.readers == nil { + return 0 + } return len(c.readers) }