mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 23:16:30 +03:00
peerstate: ignore invalid fingerprints in SQL
Normally NULL is used when there is no fingerprint, but default value
for fingerprint columns is an empty string.
In this case, loading should not fail with an "invalid length" error,
but treat the fingerprint as missing.
Strict check was introduced in commit ca95f25639
This commit is contained in:
committed by
link2xt
parent
03a4115a52
commit
dc4fa1de65
@@ -186,15 +186,18 @@ impl<'a> Peerstate<'a> {
|
||||
res.public_key_fingerprint = row
|
||||
.get::<_, Option<String>>(7)?
|
||||
.map(|s| s.parse::<Fingerprint>())
|
||||
.transpose()?;
|
||||
.transpose()
|
||||
.unwrap_or_default();
|
||||
res.gossip_key_fingerprint = row
|
||||
.get::<_, Option<String>>(8)?
|
||||
.map(|s| s.parse::<Fingerprint>())
|
||||
.transpose()?;
|
||||
.transpose()
|
||||
.unwrap_or_default();
|
||||
res.verified_key_fingerprint = row
|
||||
.get::<_, Option<String>>(10)?
|
||||
.map(|s| s.parse::<Fingerprint>())
|
||||
.transpose()?;
|
||||
.transpose()
|
||||
.unwrap_or_default();
|
||||
res.public_key = row
|
||||
.get(4)
|
||||
.ok()
|
||||
|
||||
Reference in New Issue
Block a user