Skip to content

Commit d19e1f3

Browse files
committed
fix: add nullptr check before using FindGovernanceObject() retval
1 parent 1777919 commit d19e1f3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/governance/signing.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ void GovernanceSigner::VoteGovernanceTriggers(const std::optional<const CGoverna
212212
const auto activeTriggers = m_govman.GetActiveTriggers();
213213
for (const auto& trigger : activeTriggers) {
214214
const auto govobj = m_govman.FindGovernanceObject(trigger->GetGovernanceObjHash());
215+
if (!govobj) {
216+
LogPrint(BCLog::GOBJECT, "%s -- Not voting NO-FUNDING for unknown trigger %s\n", __func__,
217+
trigger->GetGovernanceObjHash().ToString());
218+
continue;
219+
}
220+
215221
const uint256 trigger_hash = govobj->GetHash();
216222
if (trigger->GetBlockHeight() <= m_govman.GetCachedBlockHeight()) {
217223
// ignore triggers from the past

0 commit comments

Comments
 (0)