From 78b9f1bc7b9afefbae954538ab7589301052446e Mon Sep 17 00:00:00 2001 From: Rafael <1024481@stud.hs-mannheim.de> Date: Fri, 21 Jun 2024 02:15:24 +0200 Subject: [PATCH] BugFix: Key does not exist --- lib/pages/liked_users_page.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/pages/liked_users_page.dart b/lib/pages/liked_users_page.dart index d6ec45a..8fa0849 100644 --- a/lib/pages/liked_users_page.dart +++ b/lib/pages/liked_users_page.dart @@ -338,6 +338,13 @@ class LikedUsersPageState extends State { } }, onShowChat: () { + Map userMap = + user.data() as Map; + String? profilePic = + userMap.containsKey(Constants.dbFieldUsersProfilePic) + ? user[Constants.dbFieldUsersProfilePic] + : null; + Navigator.push( context, MaterialPageRoute( @@ -345,7 +352,7 @@ class LikedUsersPageState extends State { receiverEmail: user[Constants.dbFieldUsersEmail], receiverID: user[Constants.dbFieldUsersID], chatTitle: user[Constants.dbFieldUsersName], - profileImageUrl: user[Constants.dbFieldUsersProfilePic], + profileImageUrl: profilePic, ), ), );