🐛 Fix local db old data cause crash

This commit is contained in:
2024-08-19 09:19:29 +08:00
parent 7ea18dbe12
commit 0006a94632
5 changed files with 28 additions and 8 deletions

View File

@ -293,7 +293,7 @@ class _PostItemState extends State<PostItem> {
@override
Widget build(BuildContext context) {
final List<String> attachments = item.body['attachments'] is List
? item.body['attachments']?.cast<String>()
? List.from(item.body['attachments']?.whereType<String>())
: List.empty();
final hasAttachment = attachments.isNotEmpty;