Skip to content

Commit

Permalink
fix websocket crash when seeking and nothing is playing
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Oct 13, 2023
1 parent cb866b3 commit 7252330
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ 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")
}
player.seekTo(json.getLong("position"))
SocketServer.sendPlayerUpdate(context, player)
}
Expand Down

0 comments on commit 7252330

Please sign in to comment.