Check durable action optional before unwrapping
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 2m0s
Foundation / checks (network) (push) Failing after 6m44s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 33s
Foundation / checks (checks) (push) Canceled after 9m28s
Foundation / checks (client) (push) Canceled after 9m29s

This commit is contained in:
dingo
2026-10-11 03:14:35 -04:00
parent 6a2453d6ea
commit fe209092a6
2 changed files with 10 additions and 2 deletions
+4 -2
View File
@@ -1,5 +1,6 @@
#include "evo/network/intent_admission.hpp"
#include <algorithm>
#include <utility>
namespace evo::network {
namespace {
@@ -521,9 +522,10 @@ ActionLedger::find_record(const AccountId& account, std::uint64_t action_id) {
auto found = find(account, action_id);
if (!found.has_value())
return std::unexpected(found.error());
if (!found.value())
auto action = std::move(found).value();
if (!action.has_value())
return std::optional<DurableActionRecord>{};
return std::optional<DurableActionRecord>{DurableActionRecord{*found.value(), std::nullopt}};
return std::optional<DurableActionRecord>{DurableActionRecord{action.value(), std::nullopt}};
}
std::expected<std::vector<std::optional<DurableActionRecord>>, ActionLedgerError>