diff --git a/lib/src/room.dart b/lib/src/room.dart index 331d773..b20888e 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -367,7 +367,8 @@ class Room { } /// The address in the format: #roomname:homeserver.org. - String get canonicalAlias => states[EventTypes.RoomCanonicalAlias] != null + String get canonicalAlias => states[EventTypes.RoomCanonicalAlias] != null && + states[EventTypes.RoomCanonicalAlias].content['alias'] is String ? states[EventTypes.RoomCanonicalAlias].content['alias'] : '';