mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-10 18:48:11 -07:00
fix null ptrs, misuse of bencode
This commit is contained in:
+3
-3
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user