Skip to content

Commit

Permalink
Merge pull request #6388 from filecoin-project/fix/interface-conversion
Browse files Browse the repository at this point in the history
fix: conver nil to string
  • Loading branch information
LinZexiao authored Aug 6, 2024
2 parents ca832b8 + 169db63 commit 0dacb99
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 0dacb99

Please sign in to comment.