From aa889fb96bf4851cc3d5f5c3ba7ed7a64fd3abb9 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Thu, 4 Aug 2022 16:59:37 +0300 Subject: [PATCH 1/2] fix nil pointer for deal status --- cmd/boost/deal_status_cmd.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/cmd/boost/deal_status_cmd.go b/cmd/boost/deal_status_cmd.go index 93b6ea46c..6c116b6ec 100644 --- a/cmd/boost/deal_status_cmd.go +++ b/cmd/boost/deal_status_cmd.go @@ -85,19 +85,21 @@ var dealStatusCmd = &cli.Command{ return fmt.Errorf("send deal status request failed: %w", err) } - label := resp.DealStatus.Proposal.Label var lstr string - if label.IsString() { - lstr, err = label.ToString() - if err != nil { - lstr = "could not marshall deal label" - } - } else { - lbz, err := label.ToBytes() - if err != nil { - lstr = "could not marshall deal label" + if resp != nil && resp.DealStatus != nil { + label := resp.DealStatus.Proposal.Label + if label.IsString() { + lstr, err = label.ToString() + if err != nil { + lstr = "could not marshall deal label" + } } else { - lstr = "bytes: " + hex.EncodeToString(lbz) + lbz, err := label.ToBytes() + if err != nil { + lstr = "could not marshall deal label" + } else { + lstr = "bytes: " + hex.EncodeToString(lbz) + } } } From a772bc53aa0a860ea6e39b96cd9f8c6693b8f525 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Thu, 4 Aug 2022 17:01:25 +0300 Subject: [PATCH 2/2] fixup --- cmd/boost/deal_status_cmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/boost/deal_status_cmd.go b/cmd/boost/deal_status_cmd.go index 6c116b6ec..7db5d7f3f 100644 --- a/cmd/boost/deal_status_cmd.go +++ b/cmd/boost/deal_status_cmd.go @@ -117,7 +117,7 @@ var dealStatusCmd = &cli.Command{ // resp.DealStatus should always be present if there's no error, // but check just in case if resp.DealStatus != nil { - out["label"] = label + out["label"] = lstr out["chainDealId"] = resp.DealStatus.ChainDealID out["status"] = resp.DealStatus.Status out["publishCid"] = nil