Add nullptr checks

This commit is contained in:
Bronek Kozicki
2025-03-31 16:53:58 +01:00
parent a1c21a06bc
commit b6c74303c1

View File

@@ -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<MPTIssue>();
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(