From cdcc67207c3054f84cc621f72522b798c2e324b3 Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Tue, 25 May 2021 00:30:36 +0300 Subject: [PATCH] satellite/satellitedb: fix nil panic in UpdateCheckIn Change-Id: If6ae2c3d9b7c269b0a9d652e68854091f668b5ec --- satellite/satellitedb/overlaycache.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/satellite/satellitedb/overlaycache.go b/satellite/satellitedb/overlaycache.go index c57eb9ce7..5a402a45e 100644 --- a/satellite/satellitedb/overlaycache.go +++ b/satellite/satellitedb/overlaycache.go @@ -1706,9 +1706,12 @@ func (cache *overlaycache) UpdateCheckIn(ctx context.Context, node overlay.NodeC // args $17, walletFeatures, ) - affected, affectedErr := res.RowsAffected() - if affected > 0 && err == nil && affectedErr == nil { - return nil + + if err == nil { + affected, affectedErr := res.RowsAffected() + if affectedErr == nil && affected > 0 { + return nil + } } _, err = cache.db.ExecContext(ctx, `