client.go | 5 +++++ diff --git a/client.go b/client.go index 28ba233e14ab22a61a4959535c6787cdb02984bd..25b0317cdb86b895b94f74d00ac6f98e336b068e 100644 --- a/client.go +++ b/client.go @@ -1710,6 +1710,11 @@ // 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{