We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
问题涉及到的zset接口:ZCount, ZLexCount, ZRange, ZRevRange, ZRangeByLex, ZRevRangeByLex, ZRangeByScore, ZRevRangeByScore.
以ZCount为例:
o, err := s.loadZSetRow(db, key) if err != nil { return 0, errors.Trace(err) } var count int64 = 0 f := func(o *zsetRow) error { count++ return nil } if err = o.travelInRange(s, r, f); err != nil { return 0, errors.Trace(err) }
s.loadZSetRow方法在zset集合key不存在的情况下,可能会err != nil 并且 o == nil,而代码只判断了err是否为nil,没有判断o为nil的情况。后面调用o的方法的时候就panic了。
if err != nil || o == nil { return 0, errors.Trace(err) }
改成上面这样可以解决问题,其他的接口也同样修改,麻烦看下:)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题涉及到的zset接口:ZCount, ZLexCount, ZRange, ZRevRange, ZRangeByLex, ZRevRangeByLex, ZRangeByScore, ZRevRangeByScore.
以ZCount为例:
s.loadZSetRow方法在zset集合key不存在的情况下,可能会err != nil 并且 o == nil,而代码只判断了err是否为nil,没有判断o为nil的情况。后面调用o的方法的时候就panic了。
改成上面这样可以解决问题,其他的接口也同样修改,麻烦看下:)
The text was updated successfully, but these errors were encountered: