Skip to content

Commit

Permalink
added checks for the presence of the security agent before calling se…
Browse files Browse the repository at this point in the history
…curity methods
  • Loading branch information
nr-swilloughby committed Jul 19, 2023
1 parent 99f46e0 commit a30451f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions v3/newrelic/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (txn *Transaction) startSegmentAt(at time.Time) SegmentStartTime {
// // ... code you want to time here ...
// segment.End()
func (txn *Transaction) StartSegment(name string) *Segment {
if txn != nil && txn.thread != nil && txn.thread.thread != nil && txn.thread.thread.threadID > 0 {
if IsSecurityAgentPresent() && txn != nil && txn.thread != nil && txn.thread.thread != nil && txn.thread.thread.threadID > 0 {
// async segment start
secureAgent.SendEvent("NEW_GOROUTINE_LINKER", txn.thread.getCsecData())
}
Expand Down Expand Up @@ -498,7 +498,7 @@ func (txn *Transaction) NewGoroutine() *Transaction {
return nil
}
newTxn := txn.thread.NewGoroutine()
if newTxn.thread != nil {
if IsSecurityAgentPresent() && newTxn.thread != nil {
newTxn.thread.setCsecData()
}
return newTxn
Expand Down

0 comments on commit a30451f

Please sign in to comment.