From b6c74303c1a652e70c850e09a684cb629d4d48f4 Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Mon, 31 Mar 2025 16:53:58 +0100 Subject: [PATCH] Add nullptr checks --- src/xrpld/ledger/detail/View.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xrpld/ledger/detail/View.cpp b/src/xrpld/ledger/detail/View.cpp index d733b2a004..32172d4deb 100644 --- a/src/xrpld/ledger/detail/View.cpp +++ b/src/xrpld/ledger/detail/View.cpp @@ -1288,6 +1288,8 @@ addEmptyHolding( auto const high = srcId > dstId; auto const index = keylet::line(srcId, dstId, currency); auto const sle = view.peek(keylet::account(accountID)); + if (!sle) + return tefINTERNAL; return trustCreate( view, high, @@ -1311,6 +1313,8 @@ addEmptyHolding( auto const& mptIssue = asset.get(); auto const& mptID = mptIssue.getMptID(); auto const mpt = view.peek(keylet::mptIssuance(mptID)); + if (!mpt) + return tefINTERNAL; if (mpt->getFlags() & lsfMPTLocked) return tecLOCKED; return MPTokenAuthorize::authorize(