From b708f642c19c960df14b83425248ad1b2401b039 Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 2 May 2024 13:16:37 +0200 Subject: [PATCH] fix(apb): dont panic if missing pubkey, return "" --- apb/src/key.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apb/src/key.rs b/apb/src/key.rs index 4c249f4c..8a7f6e27 100644 --- a/apb/src/key.rs +++ b/apb/src/key.rs @@ -15,7 +15,7 @@ impl PublicKey for serde_json::Value { crate::getter! { owner -> &str } fn public_key_pem(&self) -> &str { - self.get("publicKeyPem").unwrap().as_str().unwrap() + self.get("publicKeyPem").map(|x| x.as_str().unwrap_or_default()).unwrap_or_default() } }