fix(markets): check for nil tipset

check for nil tipset when check func is called to avoid panic
This commit is contained in:
hannahhoward 2020-09-04 10:04:50 -07:00
parent 52ce80f2b4
commit 5ef753bfa8

View File

@ -351,6 +351,11 @@ func (c *ClientNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID a
// Called immediately to check if the deal has already expired or been slashed
checkFunc := func(ts *types.TipSet) (done bool, more bool, err error) {
if ts == nil {
// keep listening for events
return false, true, nil
}
// Check if the deal has already expired
if sd.Proposal.EndEpoch <= ts.Height() {
onDealExpired(nil)