Fix nil pointer deref

This commit is contained in:
Max Ignatenko 2024-03-13 16:38:58 +00:00
parent e150f1da90
commit 44d2b25951

View file

@ -110,7 +110,7 @@ func (l *Lister) run(ctx context.Context) {
reposDiscovered.WithLabelValues(remote.Host).Inc() reposDiscovered.WithLabelValues(remote.Host).Inc()
} }
if record.FirstRevSinceReset == "" { if err == nil && record.FirstRevSinceReset == "" {
// Populate this field in case it's empty, so we don't have to wait for the first firehose event // Populate this field in case it's empty, so we don't have to wait for the first firehose event
// to trigger a resync. // to trigger a resync.
err := l.db.Transaction(func(tx *gorm.DB) error { err := l.db.Transaction(func(tx *gorm.DB) error {