From 5a691762ed5c6736c6adf84d727555423c044b49 Mon Sep 17 00:00:00 2001 From: kennycud Date: Mon, 23 Sep 2024 17:07:04 -0700 Subject: [PATCH] bug fix, no rows should return zero counts instead of throwing an exception --- .../repository/hsqldb/HSQLDBAccountRepository.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/qortal/repository/hsqldb/HSQLDBAccountRepository.java b/src/main/java/org/qortal/repository/hsqldb/HSQLDBAccountRepository.java index ede1ddf9..d33434d1 100644 --- a/src/main/java/org/qortal/repository/hsqldb/HSQLDBAccountRepository.java +++ b/src/main/java/org/qortal/repository/hsqldb/HSQLDBAccountRepository.java @@ -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(