From 5ef753bfa830296a3f1ad0c711719b582c9b3259 Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Fri, 4 Sep 2020 10:04:50 -0700 Subject: [PATCH] fix(markets): check for nil tipset check for nil tipset when check func is called to avoid panic --- markets/storageadapter/client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/markets/storageadapter/client.go b/markets/storageadapter/client.go index 91fc6a054dd..1d41ecf9192 100644 --- a/markets/storageadapter/client.go +++ b/markets/storageadapter/client.go @@ -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)