getFirst - check that values is not empty

This commit is contained in:
olszewskimichal 2019-02-16 11:55:23 +01:00
parent c515de138a
commit 60a7909fca
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ public class LinkedMultiValueMap<K, V> implements MultiValueMap<K, V>, Serializa
@Nullable
public V getFirst(K 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