From fcdd62d727d5a4149f6307f0adb9d2009cb48189 Mon Sep 17 00:00:00 2001 From: Paul Nicolas Date: Thu, 26 Oct 2023 16:25:19 +0200 Subject: [PATCH] fix(ledger): fix panic when checking last log (#470) fix(ledger): fix panic when checking last log id --- pkg/storage/sqlstorage/transactions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/storage/sqlstorage/transactions.go b/pkg/storage/sqlstorage/transactions.go index 337187e43..4f12f85a3 100644 --- a/pkg/storage/sqlstorage/transactions.go +++ b/pkg/storage/sqlstorage/transactions.go @@ -539,7 +539,7 @@ func (s *Store) UpdateTransactionMetadata(ctx context.Context, id uint64, metada return errors.Wrap(err, "reading last log") } - if !s.multipleInstance && s.lastTx.ID == id { + if !s.multipleInstance && s.lastTx != nil && s.lastTx.ID == id { if s.lastTx.Metadata == nil { s.lastTx.Metadata = metadata } else {