From: ctn Date: Tue, 26 Jul 2016 20:30:40 +0000 (+0300) Subject: torrentfs: fix panic when testPeer is not specified X-Git-Tag: v1.0.0~625^2 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=a3739fc47ce025203fe7af646d60b5133f831fb1;p=btrtrc.git torrentfs: fix panic when testPeer is not specified --- diff --git a/cmd/torrentfs/main.go b/cmd/torrentfs/main.go index 13f7c18a..b5fc23dc 100644 --- a/cmd/torrentfs/main.go +++ b/cmd/torrentfs/main.go @@ -137,12 +137,15 @@ func main() { resolveTestPeerAddr() fs := torrentfs.New(client) go exitSignalHandlers(fs) - go func() { - for { - addTestPeer(client) - time.Sleep(10 * time.Second) - } - }() + + if testPeerAddr != nil { + go func() { + for { + addTestPeer(client) + time.Sleep(10 * time.Second) + } + }() + } if err := fusefs.Serve(conn, fs); err != nil { log.Fatal(err)