From 48dc85bfd33f9e3636ea1c0d4399d58e2faf7806 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 25 Feb 2015 14:51:56 +1100 Subject: [PATCH] Return no Files if Torrent Info isn't available --- client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client.go b/client.go index 28ba233e..25b0317c 100644 --- a/client.go +++ b/client.go @@ -1710,6 +1710,11 @@ func (f *File) PrioritizeRegion(off, len int64) { // Returns handles to the files in the torrent. This requires the metainfo is // available first. func (t Torrent) Files() (ret []File) { + select { + case <-t.GotMetainfo: + default: + return + } var offset int64 for _, fi := range t.Info.UpvertedFiles() { ret = append(ret, File{ -- 2.48.1