From: Matt Joiner Date: Wed, 23 Jul 2014 04:55:38 +0000 (+1000) Subject: torrentfs: Support torrents that don't yet have their metadata X-Git-Tag: v1.0.0~1646 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=1ceb470bfca359ecb49fe17da2dc54d343458894;p=btrtrc.git torrentfs: Support torrents that don't yet have their metadata --- diff --git a/fs/torrentfs.go b/fs/torrentfs.go index 726b8fe5..d1c6732c 100644 --- a/fs/torrentfs.go +++ b/fs/torrentfs.go @@ -174,7 +174,7 @@ func isSingleFileTorrent(md *metainfo.Info) bool { func (me rootNode) Lookup(name string, intr fusefs.Intr) (_node fusefs.Node, err fuse.Error) { for _, t := range me.fs.Client.Torrents() { - if t.Name() != name { + if t.Name() != name || t.Info == nil { continue } __node := node{ @@ -198,6 +198,9 @@ func (me rootNode) Lookup(name string, intr fusefs.Intr) (_node fusefs.Node, err func (me rootNode) ReadDir(intr fusefs.Intr) (dirents []fuse.Dirent, err fuse.Error) { for _, _torrent := range me.fs.Client.Torrents() { metaInfo := _torrent.Info + if metaInfo == nil { + continue + } dirents = append(dirents, fuse.Dirent{ Name: metaInfo.Name, Type: func() fuse.DirentType {