Skip to content

Commit

Permalink
[fix]HASH支持返回空元素。fix: #130
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Jun 17, 2024
1 parent df1a267 commit 95e7f06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion NewLife.Redis/RedisBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ protected virtual Packet ToBytes(Object value)
if (type == typeof(Byte[])) return pk.ToArray();
if (type.As<IAccessor>()) return type.AccessorRead(pk);

var str = pk.ToStr().Trim('\"');
var str = pk.ToStr() ?? "";
str = str.Trim('\"');
if (type.GetTypeCode() == TypeCode.String) return str;
if (type.GetTypeCode() != TypeCode.Object) return str.ChangeType(type);

Expand Down

0 comments on commit 95e7f06

Please sign in to comment.