diff --git a/chatbot/src/main/kotlin/space/mori/chzzk_bot/chatbot/chzzk/ChzzkHandler.kt b/chatbot/src/main/kotlin/space/mori/chzzk_bot/chatbot/chzzk/ChzzkHandler.kt index 0883a10..3382842 100644 --- a/chatbot/src/main/kotlin/space/mori/chzzk_bot/chatbot/chzzk/ChzzkHandler.kt +++ b/chatbot/src/main/kotlin/space/mori/chzzk_bot/chatbot/chzzk/ChzzkHandler.kt @@ -224,7 +224,10 @@ class UserHandler( } try { val tokens = user.refreshToken?.let { token -> Connector.client.refreshAccessToken(token) } - client = Connector.getClient(tokens!!.first, tokens.second) + if(tokens == null) { + throw RuntimeException("AccessToken is not valid.") + } + client = Connector.getClient(tokens.first, tokens.second) UserService.setRefreshToken(user, tokens.first, tokens.second) chatChannelId = getChzzkChannelId(channel.channelId)