Skip to content

Commit 5953ba3

Browse files
committed
fixed some bugs about reading attributes from undefined
1 parent ecfe06a commit 5953ba3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

templates/chain-admin/hooks/asset-list/useChainUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const useChainUtils = (chainName: string) => {
7878

7979
const getExponentByDenom = (denom: CoinDenom): Exponent => {
8080
const asset = getAssetByDenom(denom);
81-
const unit = asset.denomUnits.find(({ denom }) => denom === asset.display);
81+
const unit = asset?.denomUnits.find(({ denom }) => denom === asset.display);
8282
return unit?.exponent || 0;
8383
};
8484

templates/chain-admin/hooks/voting/useVotingData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export function useVotingData(chainName: string) {
171171
Object.entries(singleQueries).map(([key, query]) => [key, query.data])
172172
) as SingleQueriesData;
173173

174-
singleQueriesData?.proposals.forEach((proposal) => {
174+
singleQueriesData?.proposals?.forEach((proposal) => {
175175
if (proposal.status === ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD) {
176176
(async () => {
177177
for (const { address } of chain?.apis?.rest || []) {

0 commit comments

Comments
 (0)