From 220295d8476fc3b9a4634788d7f0990753e3a3b3 Mon Sep 17 00:00:00 2001 From: Francis Toth Date: Wed, 14 Sep 2022 15:57:57 -0400 Subject: [PATCH] Fixed option decoding for empty tags --- .../main/scala/ru/tinkoff/phobos/decoding/ElementDecoder.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/main/scala/ru/tinkoff/phobos/decoding/ElementDecoder.scala b/modules/core/src/main/scala/ru/tinkoff/phobos/decoding/ElementDecoder.scala index a7d371e..c38c196 100644 --- a/modules/core/src/main/scala/ru/tinkoff/phobos/decoding/ElementDecoder.scala +++ b/modules/core/src/main/scala/ru/tinkoff/phobos/decoding/ElementDecoder.scala @@ -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 {