Skip to content

Commit

Permalink
fix interface nil exception (#208)
Browse files Browse the repository at this point in the history
Co-authored-by: lin.tan <[email protected]>
  • Loading branch information
exgalibas and lin.tan authored Oct 10, 2024
1 parent 5cd5cc7 commit 3981a26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/core/logreport.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package core

import (
"fmt"
"reflect"
"time"

"github.com/apache/skywalking-go/plugins/core/operator"
Expand Down Expand Up @@ -111,7 +112,7 @@ func (t *Tracer) GetLogContext(withEndpoint bool) interface{} {
}
}
entity := t.Entity()
if e, ok := entity.(operator.Entity); ok && e != nil {
if e, ok := entity.(operator.Entity); ok && e != nil && !reflect.ValueOf(e).IsNil() {
serviceName, instanceName = e.GetServiceName(), e.GetInstanceName()
}
return &SkyWalkingLogContext{
Expand Down

0 comments on commit 3981a26

Please sign in to comment.