From 19b8e377c41e799825bb543db5e53df6226d1726 Mon Sep 17 00:00:00 2001 From: oneRain Date: Wed, 27 Jan 2021 11:45:44 +0800 Subject: [PATCH] fix: get non-exist key exception --- Realtime/Realtime/Conversation/LCIMConversation.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Realtime/Realtime/Conversation/LCIMConversation.cs b/Realtime/Realtime/Conversation/LCIMConversation.cs index f74ace8..ed6e75b 100644 --- a/Realtime/Realtime/Conversation/LCIMConversation.cs +++ b/Realtime/Realtime/Conversation/LCIMConversation.cs @@ -136,7 +136,10 @@ namespace LeanCloud.Realtime { /// public object this[string key] { get { - return customProperties[key]; + if (customProperties.TryGetValue(key, out object val)) { + return val; + } + return null; } set { customProperties[key] = value;