From 57c8553aea4cafba7dbb80423cb18a29b1555f84 Mon Sep 17 00:00:00 2001 From: jackburrus Date: Tue, 8 Oct 2024 18:10:46 -0600 Subject: [PATCH] Adds missing null check for morpho rate --- apps/hyperdrive-trading/src/ui/rewards/useMorphoRate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/hyperdrive-trading/src/ui/rewards/useMorphoRate.ts b/apps/hyperdrive-trading/src/ui/rewards/useMorphoRate.ts index 4401b08dd..86e56590e 100644 --- a/apps/hyperdrive-trading/src/ui/rewards/useMorphoRate.ts +++ b/apps/hyperdrive-trading/src/ui/rewards/useMorphoRate.ts @@ -53,7 +53,7 @@ export function useMorphoRate({ // If there is no matching rate, just use the first one in the current_rates array if (!matchingRate) { - matchingRate = rewardsData.current_rates[0].per_dollar_per_year; + matchingRate = rewardsData.current_rates[0]?.per_dollar_per_year; } // The morpho rate is formatted to 15 decimal places