We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the scenario where the data source is empty the library crashes throwing Method java.lang.IndexOutOfBoundsException exception.
java.lang.IndexOutOfBoundsException
Code used to test this:
assertNull(BerTlv.parse("".toByteArray()))
I think this can be easily fixed by this change in the BerTlv.java class:
BerTlv.java
@JvmStatic fun parse(data: ByteArray): BerTlv { if (data.isNotEmpty()) { return parseList(ByteBuffer.wrap(data), true)[0] } else { null } }
The text was updated successfully, but these errors were encountered:
Meanwhile I've created an extension function that does the validation before using the static BerTlv.parse() method:
BerTlv.parse()
fun String.parseBerTlv(): BerTlv? { return if (ISOUtil.isValidHexString(this)) { BerTlv.parse(this.decodeHex()) } else { null } }
Sorry, something went wrong.
No branches or pull requests
In the scenario where the data source is empty the library crashes throwing Method
java.lang.IndexOutOfBoundsException
exception.Code used to test this:
I think this can be easily fixed by this change in the
BerTlv.java
class:The text was updated successfully, but these errors were encountered: