BATCH-1033: Updated to account for the possibility of a null key in the map
This commit is contained in:
@@ -56,13 +56,14 @@ public class PrefixMatchingCompositeLineTokenizer implements LineTokenizer, Init
|
||||
|
||||
if (line != null) {
|
||||
for (String key : delegates.keySet()) {
|
||||
if ("".equals(key)) {
|
||||
defaultDelegate = delegates.get(key);
|
||||
// don't break here or the delegate may not be found
|
||||
}
|
||||
else if (line.startsWith(key)) {
|
||||
delegate = delegates.get(key);
|
||||
break;
|
||||
if (key != null) {
|
||||
if ("".equals(key)) {
|
||||
defaultDelegate = delegates.get(key);
|
||||
}
|
||||
else if (line.startsWith(key)) {
|
||||
delegate = delegates.get(key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user