diff --git a/LavalinkServer/src/main/java/lavalink/server/io/WebSocketHandler.kt b/LavalinkServer/src/main/java/lavalink/server/io/WebSocketHandler.kt index e79db30ca..591952c80 100644 --- a/LavalinkServer/src/main/java/lavalink/server/io/WebSocketHandler.kt +++ b/LavalinkServer/src/main/java/lavalink/server/io/WebSocketHandler.kt @@ -127,6 +127,10 @@ class WebSocketHandler( private fun seek(json: JSONObject) { val player = context.getPlayer(json.getLong("guildId")) + if (!player.isPlaying) { + log.warn("Can't seek when player is not playing anything") + return + } player.seekTo(json.getLong("position")) SocketServer.sendPlayerUpdate(context, player) } diff --git a/LavalinkServer/src/main/java/lavalink/server/player/PlayerRestHandler.kt b/LavalinkServer/src/main/java/lavalink/server/player/PlayerRestHandler.kt index 91ee3fe6a..fe0e4fe92 100644 --- a/LavalinkServer/src/main/java/lavalink/server/player/PlayerRestHandler.kt +++ b/LavalinkServer/src/main/java/lavalink/server/player/PlayerRestHandler.kt @@ -121,7 +121,7 @@ class PlayerRestHandler( playerUpdate.position.takeIf { it.isPresent && !playerUpdate.encodedTrack.isPresent && !playerUpdate.identifier.isPresent } ?.let { if (player.isPlaying) { - player.seekTo(it) + player.seekTo(it.value) SocketServer.sendPlayerUpdate(context, player) } }