Skip to content

Commit 6a58bc9

Browse files
committed
fix panic in span reporting
1 parent 4068af9 commit 6a58bc9

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v3.95.6
2+
* Fixed panic on span reporting in `xsql/Tx`
3+
14
## v3.95.5
25
* Fixed goroutine leak on failed execute call in query client
36

internal/xsql/legacy/tx.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ type transaction struct {
2020
}
2121

2222
func (tx *transaction) ID() string {
23+
if tx.tx == nil {
24+
return ""
25+
}
26+
2327
return tx.tx.ID()
2428
}
2529

internal/xsql/tx.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ type Tx struct {
1818
}
1919

2020
func (tx *Tx) ID() string {
21+
if tx.tx == nil {
22+
return ""
23+
}
24+
2125
return tx.tx.ID()
2226
}
2327

0 commit comments

Comments
 (0)