获取key报错fix

This commit is contained in:
SongZhang 2024-09-27 17:42:05 +08:00
parent 5376962c34
commit 723cf01696
1 changed files with 3 additions and 1 deletions

View File

@ -35,7 +35,9 @@ public interface RedisConstant {
static String getLockKey(String sign, Object... args) {
StringBuilder key = new StringBuilder(LOCK_KEY + ":" + sign + ":");
for (Object arg : args) {
key.append(":").append(arg.toString());
if (arg != null) {
key.append(":").append(arg);
}
}
return key.toString();
}