From 58e425b71ae9c7944f37f3b5b57044fa407bedd8 Mon Sep 17 00:00:00 2001 From: Gustavo Inacio Date: Thu, 29 Aug 2024 17:58:27 +0200 Subject: [PATCH] fix: in case the graphql returns empty Signed-off-by: Gustavo Inacio --- packages/indexer-common/src/allocations/query-fees.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/indexer-common/src/allocations/query-fees.ts b/packages/indexer-common/src/allocations/query-fees.ts index 4f0c1b235..ab50fc66b 100644 --- a/packages/indexer-common/src/allocations/query-fees.ts +++ b/packages/indexer-common/src/allocations/query-fees.ts @@ -690,7 +690,11 @@ export class AllocationReceiptCollector implements ReceiptCollector { ), }, ) - return response.data! + if (!response.data) { + throw `There was an error while querying Tap Subgraph. Errors: ${response.error}` + } + + return response.data } // for every allocation_id of this list that contains the redeemedAt less than the current