Skip to content

Commit bd05652

Browse files
committed
Fix null access
1 parent 548614a commit bd05652

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/widgets/posts.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ List<_PostListItem> _decodePostsAndTheirReplies(List jsonPosts) {
4141
final post = Post.fromJson(map);
4242
final postReplies = post.postReplies.map((postReply) {
4343
final item = _PostListItem.postReply(postReply);
44-
postReplyItemById[postReply.postId!] = item;
44+
final postId = postReply.postId;
45+
if (postId != null) {
46+
postReplyItemById[postId] = item;
47+
}
4548
return item;
4649
});
4750

0 commit comments

Comments
 (0)