From 0f175ab04548aa2562a02ef2d709a49661897198 Mon Sep 17 00:00:00 2001 From: dalbodeule <11470513+dalbodeule@users.noreply.github.com> Date: Thu, 8 Aug 2024 20:23:03 +0900 Subject: [PATCH] fix User.kt - set "discord", "token" row to nullable. --- .../space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt index b011317..13dd42f 100644 --- a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt +++ b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt @@ -93,14 +93,14 @@ fun Routing.apiRoutes() { user = UserService.saveUser(session.nickname, session.id) } val songConfig = SongConfigService.getConfig(user) - val status = getStreamInfo(user.token!!) + val status = user.token?.let { it1 -> getStreamInfo(it1) } - if(status.content == null) { + if(status?.content == null) { call.respondText(user.naverId, status = HttpStatusCode.NotFound) } call.respond(HttpStatusCode.OK, GetSessionDTO( - status.content!!.channel.channelId, + status!!.content!!.channel.channelId, status.content!!.channel.channelName, status.content!!.status == "OPEN", status.content!!.channel.channelImageUrl,