RSS-190: Fixed nullpointer in addFileAttribute if fileAttribute was manually removed
This commit is contained in:
parent
027b4cd5b3
commit
3aa75c5e91
@ -251,7 +251,7 @@ public class Section {
|
||||
fileAttributes = new ArrayList<>();
|
||||
}
|
||||
|
||||
boolean exists = fileAttributes.stream().anyMatch(f -> f.getLabel().equals(label) && f.getValue().equals(value));
|
||||
boolean exists = fileAttributes.stream().anyMatch(f -> f.getLabel() != null && f.getLabel().equals(label) && f.getValue() != null && f.getValue().equals(value));
|
||||
|
||||
if (!exists) {
|
||||
fileAttributes.add(FileAttribute.builder().label(label).value(value).build());
|
||||
@ -278,7 +278,7 @@ public class Section {
|
||||
while (matcher.find()) {
|
||||
String match = matcher.group(group);
|
||||
if (StringUtils.isNotBlank(match)) {
|
||||
boolean exists = fileAttributes.stream().anyMatch(f -> f.getLabel().equals(label) && f.getValue().equals(match));
|
||||
boolean exists = fileAttributes.stream().anyMatch(f -> f.getLabel() != null && f.getLabel().equals(label) && f.getValue() != null && f.getValue().equals(match));
|
||||
|
||||
if (!exists) {
|
||||
fileAttributes.add(FileAttribute.builder().label(label).value(match).build());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user