diff --git a/lib/src/room.dart b/lib/src/room.dart index ef504c87..a5600619 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -249,8 +249,10 @@ class Room { } final directChatMatrixID = this.directChatMatrixID; - final heroes = summary.mHeroes ?? - (directChatMatrixID == null ? [] : [directChatMatrixID]); + final heroes = summary.mHeroes ?? []; + if (directChatMatrixID != null && heroes.isEmpty) { + heroes.add(directChatMatrixID); + } if (heroes.isNotEmpty) { final result = heroes .where(