mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
return null for tor-key pointer if doesn't exist
This commit is contained in:
committed by
Aiden McClelland
parent
666f1bc0eb
commit
75dbc0bd76
@@ -1849,13 +1849,17 @@ impl TorKeyPointer {
|
||||
*self.package_id,
|
||||
*self.interface
|
||||
)
|
||||
.fetch_one(secrets)
|
||||
.fetch_optional(secrets)
|
||||
.await
|
||||
.map_err(|e| ConfigurationError::SystemError(e.into()))?;
|
||||
Ok(Value::String(base32::encode(
|
||||
base32::Alphabet::RFC4648 { padding: false },
|
||||
&x.key,
|
||||
)))
|
||||
if let Some(x) = x {
|
||||
Ok(Value::String(base32::encode(
|
||||
base32::Alphabet::RFC4648 { padding: false },
|
||||
&x.key,
|
||||
)))
|
||||
} else {
|
||||
Ok(Value::Null)
|
||||
}
|
||||
}
|
||||
}
|
||||
impl fmt::Display for TorKeyPointer {
|
||||
|
||||
Reference in New Issue
Block a user