From 0eeba51d463f7a3260e2d5cc481e4069f409dd0e Mon Sep 17 00:00:00 2001 From: Rafael <1024481@stud.hs-mannheim.de> Date: Mon, 17 Jun 2024 15:37:59 +0200 Subject: [PATCH] Fix for commit 210cfd85 --- lib/components/user_tile_likes.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/components/user_tile_likes.dart b/lib/components/user_tile_likes.dart index 8050273..bf9458e 100644 --- a/lib/components/user_tile_likes.dart +++ b/lib/components/user_tile_likes.dart @@ -9,7 +9,7 @@ import '../utils/math.dart'; class UserTileLikes extends StatefulWidget { final DocumentSnapshot user; final bool hasMatch; - final UserProfile currentUser; + final UserProfile? currentUser; final VoidCallback onUnlike; final VoidCallback onShowChat; final VoidCallback onViewInfo; @@ -18,7 +18,7 @@ class UserTileLikes extends StatefulWidget { super.key, required this.user, required this.hasMatch, - required this.currentUser, + this.currentUser, required this.onUnlike, required this.onShowChat, required this.onViewInfo, @@ -58,8 +58,8 @@ class _UserTileLikesState extends State { bool hasName = userMap.containsKey(Constants.dbFieldUsersName); bool hasBio = userMap.containsKey(Constants.dbFieldUsersBio); - String? shortDist = (_otherUser != null - ? shortestDistanceBetweenUsers(widget.currentUser, _otherUser!) + String? shortDist = (_otherUser != null && widget.currentUser != null + ? shortestDistanceBetweenUsers(widget.currentUser!, _otherUser!) .toStringAsFixed(0) : null);