From 6ed1127758fabcfdd3c27f2c7b788f2dd9378d84 Mon Sep 17 00:00:00 2001 From: Olivier Poitrey Date: Thu, 20 May 2021 18:40:53 +0200 Subject: [PATCH] Fix panic on disabled event with CallerSkipFrame Fixes #319 --- event.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/event.go b/event.go index 51ea4bb..6f8341c 100644 --- a/event.go +++ b/event.go @@ -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 }