mirror of https://github.com/apache/nifi.git
NIFI-9910: This closes #5956. Call toString() on the provided key in CSVRecordLookupService instead of attempting to cast to a String
Signed-off-by: Joe Witt <joewitt@apache.org>
This commit is contained in:
parent
900a34971c
commit
b67b2bc356
|
@ -139,8 +139,13 @@ public class CSVRecordLookupService extends AbstractCSVLookupService implements
|
|||
return Optional.empty();
|
||||
}
|
||||
|
||||
final String key = (String) coordinates.get(KEY);
|
||||
if (StringUtils.isBlank(key)) {
|
||||
final Object key = coordinates.get(KEY);
|
||||
if (key == null) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
final String keyString = key.toString();
|
||||
if (StringUtils.isBlank(keyString)) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
|
@ -152,7 +157,7 @@ public class CSVRecordLookupService extends AbstractCSVLookupService implements
|
|||
throw new LookupFailureException(e.getMessage(), e);
|
||||
}
|
||||
|
||||
return Optional.ofNullable(cache.get(key));
|
||||
return Optional.ofNullable(cache.get(keyString));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue