diff --git a/NewLife.Redis.Extensions/RedisXmlRepository.cs b/NewLife.Redis.Extensions/RedisXmlRepository.cs index 3e8cf9b..47311b1 100644 --- a/NewLife.Redis.Extensions/RedisXmlRepository.cs +++ b/NewLife.Redis.Extensions/RedisXmlRepository.cs @@ -43,7 +43,7 @@ public RedisXmlRepository(Func redisFactory, String key) private IEnumerable GetAllElementsCore() { var rds = _redis ?? _redisFactory!(); - var list = rds.GetList(_key); + var list = rds.GetList(_key) ?? []; foreach (var item in list) { yield return XElement.Parse(item);