Skip to content

Commit

Permalink
Fix Kitsu synopsis nullability (mihonapp/mihon#1233)
Browse files Browse the repository at this point in the history
This time, the Kitsu API docs are silent on whether this field (or
any other field) can be null/undefined/etc, but it can happen and
caused an error during search and update. This change just ensures the
attribute is nullable and is set to an empty String when it is null.

(cherry picked from commit f5c6d2e)
  • Loading branch information
MajorTanya authored and cuong-tran committed Sep 18, 2024
1 parent dd58a90 commit 4ad0748
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ data class KitsuListSearchResult(
title = manga.canonicalTitle
total_chapters = manga.chapterCount ?: 0
cover_url = manga.posterImage?.original ?: ""
summary = manga.synopsis
summary = manga.synopsis ?: ""
tracking_url = KitsuApi.mangaUrl(remote_id)
publishing_status = manga.status
publishing_type = manga.mangaType ?: ""
Expand Down Expand Up @@ -73,7 +73,7 @@ data class KitsuListSearchItemIncludedAttributes(
val chapterCount: Long?,
val mangaType: String?,
val posterImage: KitsuSearchItemCover?,
val synopsis: String,
val synopsis: String?,
val startDate: String?,
val status: String,
)

0 comments on commit 4ad0748

Please sign in to comment.