fix(DataManager): 修正Poll函数中,key为null时异常的的问题。

This commit is contained in:
SL 2024-06-18 13:19:50 +08:00
parent 9bc880b3f0
commit c96131cfae
1 changed files with 4 additions and 2 deletions

View File

@ -224,8 +224,10 @@ namespace Aitex.Core.RT.DataCenter
}
public object Poll(string key)
{
return _keyValueMap.ContainsKey(key) ? _keyValueMap[key].Value : null;
{
if (string.IsNullOrEmpty(key))
return null;
return _keyValueMap.TryGetValue(key, out var item) ? item.Value : null;
}
public void Traverse(object instance, string keyPrefix)