Skip to content

Commit

Permalink
Fix Null Pointer Exception (#36)
Browse files Browse the repository at this point in the history
* fix null pointer

* lint

---------

Co-authored-by: Your Name <you@example.com>
  • Loading branch information
keefertaylor and Your Name authored May 13, 2024
1 parent 69d79d3 commit 3ed230f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cosmos/chain-registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ func (rc *chainRegistryClient) ChainNameForChainID(ctx context.Context, targetCh
chainInfo, err := rc.ChainInfo(ctx, chainName)
if err != nil {
rc.log.Warn().Err(err).Str("chain_name", chainName).Msg("error fetching chain information during chain id refresh, this chain will not be supported")
}
chainID = chainInfo.ChainID
} else {

chainID = chainInfo.ChainID

// Set in cache
rc.chainNameToChainID[chainName] = chainID
// Set in cache
rc.chainNameToChainID[chainName] = chainID
}
} else {
rc.log.Debug().Str("chain_name", chainName).Msg("found chain id in cache")
}
Expand Down

0 comments on commit 3ed230f

Please sign in to comment.