Skip to content

Commit

Permalink
fix: conver nil to string
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode committed Aug 6, 2024
1 parent 3fdb199 commit 169db63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ var chainExportCmd = &cmds.Command{
//
// It always gets the head from the API so commands use a consistent tipset even if time pases.
func LoadTipSet(ctx context.Context, req *cmds.Request, chainAPI v1api.IChain) (*types.TipSet, error) {
tss := req.Options["tipset"].(string)
tss, _ := req.Options["tipset"].(string)
if tss == "" {
return chainAPI.ChainHead(ctx)
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,8 @@ var StateComputeStateCmd = &cmds.Command{
var ts *types.TipSet
var err error
chainAPI := getEnv(env).ChainAPI
if tss := req.Options["tipset"].(string); tss != "" {
tss, _ := req.Options["tipset"].(string)
if tss != "" {
ts, err = ParseTipSetRef(ctx, chainAPI, tss)
} else if height > 0 {
ts, err = chainAPI.ChainGetTipSetByHeight(ctx, height, types.EmptyTSK)
Expand Down

0 comments on commit 169db63

Please sign in to comment.