From 3a19bfb54264ae668417ec28379cc18c7a26c883 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 7 Nov 2019 09:46:18 +0000 Subject: [PATCH] [User] fix null statekey --- lib/src/User.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/User.dart b/lib/src/User.dart index dcd08eb6..40ac24c1 100644 --- a/lib/src/User.dart +++ b/lib/src/User.dart @@ -106,7 +106,9 @@ class User extends RoomState { /// Returns the displayname or the local part of the Matrix ID if the user /// has no displayname. String calcDisplayname() => (displayName == null || displayName.isEmpty) - ? stateKey.replaceFirst("@", "").split(":")[0] + ? (stateKey != null + ? stateKey.replaceFirst("@", "").split(":")[0] + : "Unknown User") : displayName; /// Call the Matrix API to kick this user from this room.