From 49e060ae3f1bd5b3624e3b8a64a354e7180a7d3c Mon Sep 17 00:00:00 2001 From: Aleksei Pleshakov Date: Tue, 7 Jan 2025 17:13:19 +0100 Subject: [PATCH] fix panic in span reporting --- internal/xsql/legacy/tx.go | 3 +++ internal/xsql/tx.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/internal/xsql/legacy/tx.go b/internal/xsql/legacy/tx.go index 7aba57197..7aebf4fb4 100644 --- a/internal/xsql/legacy/tx.go +++ b/internal/xsql/legacy/tx.go @@ -20,6 +20,9 @@ type transaction struct { } func (tx *transaction) ID() string { + if tx.tx == nil { + return "" + } return tx.tx.ID() } diff --git a/internal/xsql/tx.go b/internal/xsql/tx.go index 35a395e78..ee6b41c73 100644 --- a/internal/xsql/tx.go +++ b/internal/xsql/tx.go @@ -18,6 +18,9 @@ type Tx struct { } func (tx *Tx) ID() string { + if tx.tx == nil { + return "" + } return tx.tx.ID() }