Skip to content

Fixed option decoding for empty tags #227

Merged
merged 1 commit into from
Nov 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ object ElementDecoder extends ElementLiteralInstances with DerivedElement {
def decodeAsElement(c: Cursor, localName: String, namespaceUri: Option[String]): ElementDecoder[Option[A]] = {
if (c.isStartElement) {
ElementDecoder.errorIfWrongName[Option[A]](c, localName, namespaceUri).getOrElse {
if (ElementDecoder.isNil(c) || (c.isEmptyElement && c.getAttributeInfo.getAttributeCount == 0)) {
if (ElementDecoder.isNil(c)) {
c.next()
new ConstDecoder(None)
} else {
Expand Down