Skip to content

Commit 70a8be5

Browse files
Regzoxmarob
andauthored
Update sedalib/src/main/java/fr/gouv/vitam/tools/sedalib/xml/SEDAXMLEventReader.java
Co-authored-by: Maxime Robert <robert.maxime@gmail.com>
1 parent f14da27 commit 70a8be5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

sedalib/src/main/java/fr/gouv/vitam/tools/sedalib/xml/SEDAXMLEventReader.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,7 @@ public String peekAttributeBlockIfNamed(String tag, String attribute) throws XML
376376
final StartElement startElement = peek.asStartElement();
377377
final Attribute attr = startElement.getAttributeByName(qName);
378378

379-
if (attr == null) {
380-
return null;
381-
}
382-
383-
return attr.getValue();
379+
return Optional.ofNullable(attr).map(Attribute::getValue).orElse(null);
384380
}
385381

386382
/**

0 commit comments

Comments
 (0)