diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt index 4ac3884a4..ecbb8449c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListApi.kt @@ -208,7 +208,7 @@ class MyAnimeListApi(private val client: OkHttpClient, interceptor: MyAnimeListI val obj = response.jsonObject return track.apply { val isRereading = obj["is_rereading"]!!.jsonPrimitive.boolean - status = if (isRereading) MyAnimeList.REREADING else getStatus(obj["status"]!!.jsonPrimitive.content) + status = if (isRereading) MyAnimeList.REREADING else getStatus(obj["status"]?.jsonPrimitive?.content) last_chapter_read = obj["num_chapters_read"]!!.jsonPrimitive.float score = obj["score"]!!.jsonPrimitive.int.toFloat() obj["start_date"]?.let { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListModels.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListModels.kt index 70401313c..dea4231b3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListModels.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeListModels.kt @@ -24,7 +24,7 @@ fun Track.toMyAnimeListStatus() = when (status) { else -> null } -fun getStatus(status: String) = when (status) { +fun getStatus(status: String?) = when (status) { "reading" -> MyAnimeList.READING "completed" -> MyAnimeList.COMPLETED "on_hold" -> MyAnimeList.ON_HOLD