fix: get non-exist key exception

oneRain 2021-01-27 11:45:44 +08:00
parent c46b980720
commit 19b8e377c4
1 changed files with 4 additions and 1 deletions

View File

@ -136,7 +136,10 @@ namespace LeanCloud.Realtime {
/// <returns></returns>
public object this[string key] {
get {
return customProperties[key];
if (customProperties.TryGetValue(key, out object val)) {
return val;
}
return null;
}
set {
customProperties[key] = value;