From ef58430060cebbfe684b0dbb12d2bad11cd3aaa0 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 24 Jul 2024 16:28:29 +0800 Subject: [PATCH] :bug: Fix error when body haven't attachment in post --- lib/widgets/posts/post_item.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/widgets/posts/post_item.dart b/lib/widgets/posts/post_item.dart index e2c7236..85e4563 100644 --- a/lib/widgets/posts/post_item.dart +++ b/lib/widgets/posts/post_item.dart @@ -293,7 +293,8 @@ class _PostItemState extends State { ), child: AttachmentList( parentId: widget.item.id.toString(), - attachmentsId: item.body['attachments'].cast() ?? List.empty(), + attachmentsId: + item.body['attachments']?.cast() ?? List.empty(), divided: true, ), ),