Fix nil pointer dereference

This commit is contained in:
Deluan 2020-05-25 10:54:07 -04:00
parent 72cb3850d1
commit 72e92c7318

View File

@ -43,7 +43,11 @@ func (s *scrobbler) Register(ctx context.Context, playerId int, trackId string,
return err
})
log.Info("Scrobbled", "title", mf.Title, "artist", mf.Artist, "user", userName(ctx))
if err != nil {
log.Error("Error while scrobbling", "trackId", trackId, err)
} else {
log.Info("Scrobbled", "title", mf.Title, "artist", mf.Artist, "user", userName(ctx))
}
return mf, err
}