diff --git a/lib/widgets/poll/poll_submit.dart b/lib/widgets/poll/poll_submit.dart index b7b56d1..db1d9d4 100644 --- a/lib/widgets/poll/poll_submit.dart +++ b/lib/widgets/poll/poll_submit.dart @@ -333,7 +333,8 @@ class _PollSubmitState extends ConsumerState { switch (q.type) { case SnPollQuestionType.rating: // rating: avg score (double or int) - final avg = (raw['rating'] as num).toDouble(); + final avg = (raw['rating'] as num?)?.toDouble(); + if (avg == null) break; final theme = Theme.of(context); body = Row( mainAxisAlignment: MainAxisAlignment.start, diff --git a/lib/widgets/post/post_item.dart b/lib/widgets/post/post_item.dart index d3b8a98..84ffa90 100644 --- a/lib/widgets/post/post_item.dart +++ b/lib/widgets/post/post_item.dart @@ -571,7 +571,7 @@ class PostItem extends HookConsumerWidget { onSubmit: (_) {}, ).padding(horizontal: 16, vertical: 12), ), - _ => const Placeholder(), + _ => Text('Unable show embed: ${embedData['type']}'), }, )), if (isShowReference)