Closed fiwippi closed 2 years ago
the mutex is a good catch 👀
I've reintroduced the check for the session as
if player == nil || player.LastSessionID() == nil {
return
}
This ensures that we must have a valid player and a valid session ID. The previous check is liable to panic consistently because it's checking if player
is nil
and then trying to access it using player.LastSessionID()
which will cause a NPE
. And this is better than the old check because it takes session ID into account.
Hi, I changed a little bit of code in
lavalink.go
Changes:
nil
and then checking for its session ID because that causes a nil-pointer errorExistingPlayer()
func to access the players since it already uses mutexes to access itIf there's anything I didn't understand from your code feel free to let me know.