Skip to content

Commit

Permalink
Check for errors in latest price (#2401)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophialittlejohn authored Aug 22, 2024
1 parent e514c6f commit fd9b4a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion centrifuge-app/src/utils/getLatestPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export const getLatestPrice = (
borrowerAssetTransactions: AssetTransaction[] | undefined,
decimals: number
): { value: CurrencyBalance; timestamp: number } => {
if (!borrowerAssetTransactions) return { value: new CurrencyBalance(0, decimals), timestamp: 0 }
if (!borrowerAssetTransactions || !borrowerAssetTransactions.length)
return { value: new CurrencyBalance(0, decimals), timestamp: 0 }

const latestTx = borrowerAssetTransactions[borrowerAssetTransactions.length - 1]

Expand Down

0 comments on commit fd9b4a6

Please sign in to comment.