-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用RedisHash对象HMGet方法获取对象内单个记录时偶然性报错,版本5.5.2023.1201 #130
Comments
redis.Log =XTrace.Log 打开日志,看看抛异常时redis返回报文内容是怎么样的。 |
设置Log日志,并不是为了解决你的问题,而是把日志打印出来,辅助分析问题 |
今天遇到类似的异常,经排查是因为HASH里面部分的Filed值为空值,例如:
如果获取Filed为"ApiCmId"的值则会报 “Object reference not set to aninstance of an object” 这应该是一个Bug,因为HASH的值是允许为空值的。 |
感谢反馈,从错误信息得知,空引用来自RedisBase.FromBytes,并且是返回为空字符串。 |
问题已修复! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我这里有一个简单的封装用于获取Redis Hash类型存储的单个记录,如下
但是该方法会偶尔抛出异常 Object reference not set to aninstance of an object,我通过断点调试看到 hash 对象内存在一条记录,并且key 就是我传入的 field, 但是 HMGet 方法并没有按预期返回,而是返回了 null。
包版本: 5.5.2023.1201
.NET版本: 6
请问我需要如何解决这个问题。
The text was updated successfully, but these errors were encountered: