From 97f35add2e53a04a30fb5b344d89da50b65073af Mon Sep 17 00:00:00 2001 From: Braedon Klock Date: Mon, 3 Aug 2026 17:08:42 -0400 Subject: [PATCH] fix: Add null check for account object reads (#7717) Co-authored-by: Mayukha Vadari --- src/xrpld/rpc/handlers/account/AccountObjects.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xrpld/rpc/handlers/account/AccountObjects.cpp b/src/xrpld/rpc/handlers/account/AccountObjects.cpp index 4a34ff02fc..ee2595bf94 100644 --- a/src/xrpld/rpc/handlers/account/AccountObjects.cpp +++ b/src/xrpld/rpc/handlers/account/AccountObjects.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -191,6 +192,13 @@ getAccountObjects( for (; entryIter != dirEntries.end(); ++entryIter) { auto const sleNode = ledger.read(keylet::child(*entryIter)); + if (!sleNode) + { + // LCOV_EXCL_START + UNREACHABLE("xrpl::doAccountObjects : null SLE"); + continue; + // LCOV_EXCL_STOP + } bool canAppend = true;