getFirst - check that values is not empty
This commit is contained in:
parent
c515de138a
commit
60a7909fca
|
|
@ -81,7 +81,7 @@ public class LinkedMultiValueMap<K, V> implements MultiValueMap<K, V>, Serializa
|
||||||
@Nullable
|
@Nullable
|
||||||
public V getFirst(K key) {
|
public V getFirst(K key) {
|
||||||
List<V> values = this.targetMap.get(key);
|
List<V> values = this.targetMap.get(key);
|
||||||
return (values != null ? values.get(0) : null);
|
return (values != null && !values.isEmpty() ? values.get(0) : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue