bug fix, no rows should return zero counts instead of throwing an exception

This commit is contained in:
kennycud 2024-09-23 17:07:04 -07:00
parent a530b64ae7
commit 5a691762ed

View File

@ -1296,8 +1296,11 @@ public class HSQLDBAccountRepository implements AccountRepository {
transferAssetCount = countsByType.getOrDefault(12, 0);
transferPrivsCount = countsByType.getOrDefault(40, 0);
}
// no rows -> no counts
else {
throw new DataException("trouble fetching counts for transaction types");
arbitraryCount = 0;
transferAssetCount = 0;
transferPrivsCount = 0;
}
@ -1333,8 +1336,13 @@ public class HSQLDBAccountRepository implements AccountRepository {
buyCount = countsByDirection.getOrDefault(BUY, 0);
buyAmount = amountsByDirection.getOrDefault(BUY, 0);
}
// no rows -> no counts
else {
throw new DataException("trouble fetching counts for buy/sell transactions");
sellCount = 0;
sellAmount = 0;
buyCount = 0;
buyAmount = 0;
}
return new SponsorshipReport(