From 823cdc881c15f211860f7d3f907e6cfe47b49bb5 Mon Sep 17 00:00:00 2001 From: Michael Liu Date: Thu, 9 Jan 2025 13:31:01 -0500 Subject: [PATCH] Fix stellar wallet connection --- .../src/stellar/utils/fetchStellarDepositRecord.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/huma-web-shared/src/stellar/utils/fetchStellarDepositRecord.ts b/packages/huma-web-shared/src/stellar/utils/fetchStellarDepositRecord.ts index aa51ad82..2c2d257c 100644 --- a/packages/huma-web-shared/src/stellar/utils/fetchStellarDepositRecord.ts +++ b/packages/huma-web-shared/src/stellar/utils/fetchStellarDepositRecord.ts @@ -40,7 +40,11 @@ export async function fetchStellarDepositRecord( // Get the contract data with proper durability const response = await server.getLedgerEntries(key) - const contractData = response.entries[0].val + const contractData = response.entries[0]?.val + + if (!contractData) { + return null + } if (contractData.switch() === xdr.LedgerEntryType.contractData()) { const data = scValToNative(contractData.contractData().val())