From 9382e30885aa563016abf69ce052e32c0c8efaa9 Mon Sep 17 00:00:00 2001 From: HuanCheng65 <22636177+HuanCheng65@users.noreply.github.com> Date: Fri, 2 Feb 2024 17:03:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=A0=E6=B3=95=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E7=9A=84=E5=9B=9E=E8=B4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../huanchengfly/tieba/post/repository/PbPageRepository.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/huanchengfly/tieba/post/repository/PbPageRepository.kt b/app/src/main/java/com/huanchengfly/tieba/post/repository/PbPageRepository.kt index 2c1c4e62..62cc3ef2 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/repository/PbPageRepository.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/repository/PbPageRepository.kt @@ -61,7 +61,10 @@ object PbPageRepository { } val userList = response.data_.user_list val postList = response.data_.post_list.map { + val author = it.author + ?: userList.first { user -> user.id == it.author_id } it.copy( + author_id = author.id, author = it.author ?: userList.first { user -> user.id == it.author_id }, from_forum = response.data_.forum, @@ -81,6 +84,7 @@ object PbPageRepository { } val firstPost = postList.firstOrNull { it.floor == 1 } ?: response.data_.first_floor_post?.copy( + author_id = response.data_.thread.author.id, author = response.data_.thread.author, from_forum = response.data_.forum, tid = response.data_.thread.id,