fix null ptrs, misuse of bencode

This commit is contained in:
Jimmy Zelinskie
2014-06-30 14:59:31 -04:00
parent ac45708bfd
commit 834e584f2d
5 changed files with 74 additions and 66 deletions
+3 -3
View File
@@ -49,13 +49,13 @@ func NewPeer(a *Announce, u *User, t *Torrent) *Peer {
}
var userID uint64
if u == nil {
if u != nil {
userID = u.ID
}
var torrentID uint64
if t == nil {
torrentID = u.ID
if t != nil {
torrentID = t.ID
}
return &Peer{