RSS-190: Fixed nullpointer in addFileAttribute if fileAttribute was manually removed
This commit is contained in:
parent
e55173a720
commit
c77ed8f5aa
@ -251,7 +251,7 @@ public class Section {
|
|||||||
fileAttributes = new ArrayList<>();
|
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) {
|
if (!exists) {
|
||||||
fileAttributes.add(FileAttribute.builder().label(label).value(value).build());
|
fileAttributes.add(FileAttribute.builder().label(label).value(value).build());
|
||||||
@ -278,7 +278,7 @@ public class Section {
|
|||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
String match = matcher.group(group);
|
String match = matcher.group(group);
|
||||||
if (StringUtils.isNotBlank(match)) {
|
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) {
|
if (!exists) {
|
||||||
fileAttributes.add(FileAttribute.builder().label(label).value(match).build());
|
fileAttributes.add(FileAttribute.builder().label(label).value(match).build());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user