diff --git a/pkg/sql/catalog/lease/descriptor_state.go b/pkg/sql/catalog/lease/descriptor_state.go index 8c334ef5dea2..2b11d9d4d3a6 100644 --- a/pkg/sql/catalog/lease/descriptor_state.go +++ b/pkg/sql/catalog/lease/descriptor_state.go @@ -185,7 +185,9 @@ func (t *descriptorState) upsertLeaseLocked( // is subsumed we have nothing to delete. In dual-write mode clearing // this guarantees only the old expiry based lease is cleaned up. In // Session only clearing this means the release is a no-op. - toRelease.sessionID = nil + if toRelease != nil { + toRelease.sessionID = nil + } return nil, toRelease, nil }