Skip to content

Commit

Permalink
Merge pull request #488 from balancer/fix-get-token-price-native-asset
Browse files Browse the repository at this point in the history
Fixing logic check on getTokenPriceInNativeAsset function
  • Loading branch information
brunoguerios authored Jul 17, 2023
2 parents 49d028e + a894740 commit 1bd16e0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export class CoingeckoTokenPriceService implements TokenPriceService {
},
});

if (data[tokenAddress.toLowerCase()][this.nativeAssetId] === undefined) {
if (
data[tokenAddress.toLowerCase()] === undefined ||
data[tokenAddress.toLowerCase()][this.nativeAssetId] === undefined
) {
throw Error('No price returned from Coingecko');
}

Expand Down

0 comments on commit 1bd16e0

Please sign in to comment.