mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-25 02:27:43 +01:00
Fix NPE with invalid placeholders (#1856)
Cache task was using Objects.requireNonNull which threw an NPE if an invalid placeholder was given. If this is the case, refrain from storing the value in the cache.
This commit is contained in:
parent
91ea079e28
commit
5216e854f5
@ -123,7 +123,11 @@ public class PlanPlaceholderExtension extends PlaceholderExpansion {
|
||||
if (!currentlyProcessing.contains(key)) {
|
||||
currentlyProcessing.add(key);
|
||||
processing.submitNonCritical(() -> {
|
||||
cache.put(key, Objects.requireNonNull(getPlaceholderValue(params, uuid)));
|
||||
String value = getPlaceholderValue(params, uuid);
|
||||
|
||||
if (value != null) {
|
||||
cache.put(key, value);
|
||||
}
|
||||
currentlyProcessing.remove(key);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user