diff --git a/lib/src/client.dart b/lib/src/client.dart index 68a57931..7adb57a2 100644 --- a/lib/src/client.dart +++ b/lib/src/client.dart @@ -769,7 +769,9 @@ class Client extends MatrixApi { } } profile = await getUserProfile(userId); - if (cache) _profileCache[userId] = profile; + if (cache || _profileCache.containsKey(userId)) { + _profileCache[userId] = profile; + } return Profile( userId: userId, displayName: profile.displayname,