Skip to content

Commit

Permalink
Fix NPE.
Browse files Browse the repository at this point in the history
  • Loading branch information
hs-lsong committed Dec 11, 2023
1 parent ddd35c0 commit 7ac7054
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ public Object apply(TypeConverter converter, Object o1, Object o2) {
if (Map.class.isAssignableFrom(o2.getClass())) {
Map map = (Map) o2;
if (!map.isEmpty()) {
Object key = map.keySet().iterator().next();
if (key == null) {
return Boolean.FALSE;
}
try {
Class<?> keyClass = map.keySet().iterator().next().getClass();
Class<?> keyClass = key.getClass();
return map.containsKey(converter.convert(o1, keyClass));
} catch (ELException | NoSuchElementException e) {
return Boolean.FALSE;
Expand Down

0 comments on commit 7ac7054

Please sign in to comment.