fix(apb): dont panic if missing pubkey, return ""

This commit is contained in:
əlemi 2024-05-02 13:16:37 +02:00
parent 44de7040ec
commit b708f642c1
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -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()
}
}