mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 13:06:47 +00:00
Fix potential NullPointerException in RateLimiter
This commit is contained in:
1 parent
cd6b2512e1
commit
0e6cfb460d
1 file changed
+9
-6
@@ -132,14 +132,17 @@ public class RateLimiter {
|
||||
logger.warn("Deserialization error", e);
|
||||
}
|
||||
|
||||
try {
|
||||
final String serialized = secondaryCacheCluster.withCluster(connection -> connection.sync().get(getBucketName(key)));
|
||||
if (secondaryCacheCluster != null) {
|
||||
try {
|
||||
final String serialized = secondaryCacheCluster
|
||||
.withCluster(connection -> connection.sync().get(getBucketName(key)));
|
||||
|
||||
if (serialized != null) {
|
||||
return LeakyBucket.fromSerialized(mapper, serialized);
|
||||
if (serialized != null) {
|
||||
return LeakyBucket.fromSerialized(mapper, serialized);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.warn("Deserialization error", e);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.warn("Deserialization error", e);
|
||||
}
|
||||
|
||||
return new LeakyBucket(bucketSize, leakRatePerMillis);
|
||||
|
||||
Reference in new issue
Block a user