Merge branch 'soru/fix-canonical-alias' into 'master'

fix canonical alias sometimes being null

See merge request famedly/famedlysdk!337
This commit is contained in:
Christian Pauly 2020-06-09 10:11:00 +00:00
commit a2f7dd4223

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