From f3bd288dd6a782672441a364f6730a3dd9ffc5f9 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sun, 29 Jun 2014 19:08:46 +1000 Subject: [PATCH] Fix crash writing torrent status before priorities are initialized --- torrent.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/torrent.go b/torrent.go index c5a48856..d98b3fbe 100644 --- a/torrent.go +++ b/torrent.go @@ -176,8 +176,10 @@ func (t *torrent) WriteStatus(w io.Writer) { } fmt.Fprintln(w) fmt.Fprintln(w, "Priorities: ") - for e := t.Priorities.Front(); e != nil; e = e.Next() { - fmt.Fprintf(w, "\t%v\n", e.Value) + if t.Priorities != nil { + for e := t.Priorities.Front(); e != nil; e = e.Next() { + fmt.Fprintf(w, "\t%v\n", e.Value) + } } for _, c := range t.Conns { c.WriteStatus(w) -- 2.50.0