Fix lettuce NullPointerException (#599)
This commit is contained in:
parent
9a65fcbd6b
commit
afa257811b
|
|
@ -153,6 +153,7 @@ Callable {
|
|||
* Support asynchronous invocation in jetty client 9.0 and 9.x plugin
|
||||
* Add nacos-client 2.x plugin
|
||||
* Staticize the tags for preventing synchronization in JDK 8
|
||||
* Fix NullPointerException in lettuce-5.x-plugin.
|
||||
|
||||
#### Documentation
|
||||
|
||||
|
|
|
|||
|
|
@ -101,9 +101,12 @@ public class RedisChannelWriterInterceptor implements InstanceMethodsAroundInter
|
|||
CommandArgs<?, ?> args = redisCommand.getArgs();
|
||||
if (args == null) {
|
||||
return Constants.EMPTY_STRING;
|
||||
}
|
||||
}
|
||||
ByteBuffer firstEncodedKey = args.getFirstEncodedKey();
|
||||
String key = STRING_CODEC.decodeKey(firstEncodedKey);
|
||||
if (firstEncodedKey == null) {
|
||||
return Constants.EMPTY_STRING;
|
||||
}
|
||||
String key = STRING_CODEC.decodeKey(firstEncodedKey);
|
||||
if (StringUtil.isNotEmpty(key) && key.length() > LettucePluginConfig.Plugin.Lettuce.REDIS_PARAMETER_MAX_LENGTH) {
|
||||
key = StringUtil.cut(key, LettucePluginConfig.Plugin.Lettuce.REDIS_PARAMETER_MAX_LENGTH) + ABBR;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue