fix: Do not crash when adding a watchtower alert for a missing cipher item
This commit is contained in:
parent
f8c77ea34d
commit
67ace9692d
|
@ -145,6 +145,9 @@ private class WatchtowerClient(
|
||||||
val results = processor.process(ciphers)
|
val results = processor.process(ciphers)
|
||||||
db.transaction {
|
db.transaction {
|
||||||
results.forEach { r ->
|
results.forEach { r ->
|
||||||
|
// We might be inserting a threat report on a cipher that
|
||||||
|
// does not exist anymore. This is fine, just ignore it.
|
||||||
|
runCatching {
|
||||||
db.watchtowerThreatQueries.upsert(
|
db.watchtowerThreatQueries.upsert(
|
||||||
value = r.value,
|
value = r.value,
|
||||||
threat = r.threat && !r.cipher.deleted,
|
threat = r.threat && !r.cipher.deleted,
|
||||||
|
@ -156,6 +159,7 @@ private class WatchtowerClient(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.flowOn(Dispatchers.Default)
|
.flowOn(Dispatchers.Default)
|
||||||
.launchIn(this)
|
.launchIn(this)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue