fix User.kt

- set "discord", "token" row to nullable.
This commit is contained in:
dalbodeule 2024-08-08 20:23:03 +09:00
parent f2a871d664
commit 0f175ab045
No known key found for this signature in database
GPG Key ID: EFA860D069C9FA65

View File

@ -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,