Add sanity check for sponsoringAccountCount = 0

This commit is contained in:
tequ
2026-01-30 20:36:43 +09:00
parent 7cdaa24e63
commit 40cf5993c1

View File

@@ -410,6 +410,11 @@ DeleteAccount::doApply()
auto const sponsoringAccountCount = sponsorSle->getFieldU32(sfSponsoringAccountCount);
if (sponsoringAccountCount == 0)
// sanity check
// Since sfSponsoringAccountCount is set to soeDEFAULT, the field will not be populated with a value of 0.
return tefINTERNAL; // LCOV_EXCL_LINE
if (sponsoringAccountCount == 1)
sponsorSle->makeFieldAbsent(sfSponsoringAccountCount);
else