Skip to content

Commit 92947e0

Browse files
sethmoocopybara-github
authored andcommitted
KeyDescription.parseFrom return a nullable value
Previously, parseFrom would panic if parseFrom was called on a cert that did not have the key key description OID. PiperOrigin-RevId: 852863153
1 parent 851433e commit 92947e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/Extension.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ data class KeyDescription(
173173
fun parseFrom(cert: X509Certificate, logFn: (String) -> Unit = {}) =
174174
cert
175175
.getExtensionValue(OID.id)
176-
.let { ASN1OctetString.getInstance(it).octets }
177-
.let { parseFrom(it, logFn) }
176+
?.let { ASN1OctetString.getInstance(it).octets }
177+
?.let { parseFrom(it, logFn) }
178178

179179
@JvmStatic
180180
@JvmOverloads

0 commit comments

Comments
 (0)