Fix panic on disabled event with CallerSkipFrame

Fixes #319
This commit is contained in:
Olivier Poitrey 2021-05-20 18:40:53 +02:00
parent 47a03bc5eb
commit 6ed1127758
1 changed files with 3 additions and 0 deletions

View File

@ -698,6 +698,9 @@ func (e *Event) Interface(key string, i interface{}) *Event {
// CallerSkipFrame instructs any future Caller calls to skip the specified number of frames.
// This includes those added via hooks from the context.
func (e *Event) CallerSkipFrame(skip int) *Event {
if e == nil {
return e
}
e.skipFrame += skip
return e
}