This commit is contained in:
Looly
2022-06-10 09:00:30 +08:00
parent ea7716a517
commit 16dfcf3154
2 changed files with 3 additions and 3 deletions

View File

@@ -96,7 +96,7 @@ public class SimpleCache<K, V> implements Iterable<Map.Entry<K, V>>, Serializabl
*/
public V get(K key, Predicate<V> validPredicate, Func0<V> supplier) {
V v = get(key);
if((null != validPredicate && false == validPredicate.test(v))){
if((null != validPredicate && null != v && false == validPredicate.test(v))){
v = null;
}
if (null == v && null != supplier) {