From 7ed6dcce67775924c91caa85d8805ea7c6b877d0 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Fri, 5 Jun 2020 17:12:50 +0200 Subject: [PATCH] fix canonical alias sometimes being null --- lib/src/room.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'] : '';