Skip to content

Commit

Permalink
Unmapped polymorphic elements will no longer be added to collections …
Browse files Browse the repository at this point in the history
…as nulls
  • Loading branch information
alturkovic committed Sep 18, 2020
1 parent 5fbc9f1 commit 46f323a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.alturkovic</groupId>
<artifactId>asn-parser</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>

<name>asn-parser</name>
<description>ASN.1 Decoding/Encoding</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ private void decodeCollection(final Collection<Object> collection, final byte[]
collection.add(decodePolymorphic(asnClassDescription, elementBerData.toTlv()));
} else if (taggedField.getElementTag().equals(parsedElementTag)) {
if (taggedField.isStructured()) {
collection.add(decodeStructure(taggedField.getType(), elementBerData.toTlv()));
final Object decoded = decodeStructure(taggedField.getType(), elementBerData.toTlv());
if (decoded != null) {
collection.add(decoded);
}
} else {
//noinspection unchecked
final var asnConverter = loadAsnConverterFromCache((Class<? extends AsnConverter<byte[], Object>>) taggedField.getConverter());
Expand Down

0 comments on commit 46f323a

Please sign in to comment.