diff --git a/src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp b/src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp index 8d96301947..ca898ca307 100644 --- a/src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp @@ -169,6 +169,8 @@ preclaimUpdate(PreclaimContext const& ctx, AccountID const& account, uint256 con } } + XRPL_ASSERT(sleVault, "xrpl::LoanBrokerSet::preclaimUpdate : sleVault is initialized"); + if (account != sleBroker->at(sfOwner)) { JLOG(ctx.j.warn()) << "Account is not the owner of the LoanBroker."; diff --git a/src/test/app/LoanBroker_test.cpp b/src/test/app/LoanBroker_test.cpp index aa4cf59421..e7892fd68f 100644 --- a/src/test/app/LoanBroker_test.cpp +++ b/src/test/app/LoanBroker_test.cpp @@ -1951,6 +1951,16 @@ class LoanBroker_test : public beast::unit_test::suite ter(temINVALID), THISLINE); } + + // Pre-amendment: zero VaultID on update → temINVALID + { + testcase("LoanBrokerSet pre-amendment: zero VaultID on update"); + Env env(*this); + env.disableFeature(fixLendingProtocolV1_1); + auto const [vaultID, brokerKL] = setup(env); + + env(set(alice, uint256{}), loanBrokerID(brokerKL.key), ter(temINVALID), THISLINE); + } } public: