From 26ad0c0997417105f47f4df69bdc8bd725939871 Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Wed, 12 Feb 2025 11:18:03 +0000 Subject: [PATCH] Check for nil client/syncmanager before requesting history Needed here because this method gets fired off in background goroutines meaning they might be nil-ed by the time it executes. --- pkg/connector/backfill.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/connector/backfill.go b/pkg/connector/backfill.go index fa572ff..1c82dec 100644 --- a/pkg/connector/backfill.go +++ b/pkg/connector/backfill.go @@ -126,6 +126,9 @@ func (m *MetaClient) handleUpdateExistingMessageRange(tk handlerParams, rng *tab } func (m *MetaClient) requestMoreHistory(ctx context.Context, threadID, minTimestampMS int64, minMessageID string) bool { + if m.Client == nil || m.Client.SyncManager == nil { + return false + } resp, err := m.Client.ExecuteTasks(&socket.FetchMessagesTask{ ThreadKey: threadID, Direction: 0,