fix canonical alias sometimes being null

This commit is contained in:
Sorunome 2020-06-05 17:12:50 +02:00
parent 3975bcaea5
commit 7ed6dcce67
No known key found for this signature in database
GPG key ID: B19471D07FC9BE9C

View file

@ -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']
: '';