HHH-13645 : StatsNamedContainer#getOrCompute throws NullPointerException when computed value is null
This commit is contained in:
parent
a7d9d75e94
commit
7b104e5ded
|
@ -54,6 +54,10 @@ final class StatsNamedContainer<V> {
|
|||
}
|
||||
else {
|
||||
final V v2 = function.apply( key );
|
||||
if ( v2 == null ) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
final V v3 = map.putIfAbsent( key, v2 );
|
||||
if ( v3 == null ) {
|
||||
return v2;
|
||||
|
@ -63,6 +67,7 @@ final class StatsNamedContainer<V> {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public V get(final String key) {
|
||||
return map.get( key );
|
||||
|
|
Loading…
Reference in New Issue