mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 03:28:04 +01:00
Fix potential NullPointerException in RateLimiter
This commit is contained in:
@@ -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