mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +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.package_id,
|
||||||
*self.interface
|
*self.interface
|
||||||
)
|
)
|
||||||
.fetch_one(secrets)
|
.fetch_optional(secrets)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| ConfigurationError::SystemError(e.into()))?;
|
.map_err(|e| ConfigurationError::SystemError(e.into()))?;
|
||||||
Ok(Value::String(base32::encode(
|
if let Some(x) = x {
|
||||||
base32::Alphabet::RFC4648 { padding: false },
|
Ok(Value::String(base32::encode(
|
||||||
&x.key,
|
base32::Alphabet::RFC4648 { padding: false },
|
||||||
)))
|
&x.key,
|
||||||
|
)))
|
||||||
|
} else {
|
||||||
|
Ok(Value::Null)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl fmt::Display for TorKeyPointer {
|
impl fmt::Display for TorKeyPointer {
|
||||||
|
|||||||
Reference in New Issue
Block a user