File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -115,11 +115,16 @@ async function Page({ params }: { params: Promise<{ locale: Lang }> }) {
115
115
const ethereumStablecoinData = stablecoins
116
116
. map ( ( { id, ...rest } ) => {
117
117
const coinMarketData = stablecoinsData . find ( ( coin ) => coin . id === id )
118
- if ( ! coinMarketData )
119
- throw new Error ( "CoinGecko stablecoin data not found:" + id )
118
+ if ( ! coinMarketData ) {
119
+ console . warn ( "CoinGecko stablecoin data not found:" , id )
120
+ return null
121
+ }
120
122
return { ...coinMarketData , ...rest }
121
123
} )
122
- . filter ( ( coin ) => coin . market_cap >= MIN_MARKET_CAP_USD )
124
+ . filter (
125
+ ( coin ) : coin is Exclude < typeof coin , null > =>
126
+ coin !== null && coin . market_cap >= MIN_MARKET_CAP_USD
127
+ )
123
128
. sort ( ( a , b ) => b . market_cap - a . market_cap )
124
129
. map ( ( { market_cap, ...rest } ) => ( {
125
130
...rest ,
You can’t perform that action at this time.
0 commit comments