From 8e0373cdb96c8bf5e58d0b6b43c44a48068b5040 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 14 Feb 2020 13:16:26 +0000 Subject: [PATCH] =?UTF-8?q?[States]=C2=A0Return=20null=20on=20null=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/utils/states_map.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/utils/states_map.dart b/lib/src/utils/states_map.dart index ca08617..a399516 100644 --- a/lib/src/utils/states_map.dart +++ b/lib/src/utils/states_map.dart @@ -9,6 +9,7 @@ class StatesMap { /// If you just enter a MatrixID, it will try to return the corresponding m.room.member event. dynamic operator [](String key) { //print("[Warning] This method will be depracated in the future!"); + if (key == null) return null; if (key.startsWith("@") && key.contains(":")) { if (!states.containsKey("m.room.member")) states["m.room.member"] = {}; return states["m.room.member"][key];