From 889198139639018f565cba4816e916fc77d18785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flc=E3=82=9B?= Date: Sat, 15 Apr 2023 19:03:16 +0800 Subject: [PATCH] fix: Fix `StoppableEvent` (#11) --- dispatcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dispatcher.go b/dispatcher.go index 8d18c5c..7c39978 100644 --- a/dispatcher.go +++ b/dispatcher.go @@ -31,7 +31,7 @@ func (d *Dispatcher) Listen(name string, listener ...Listener) { // Dispatch event to all listeners func (d *Dispatcher) Dispatch(event Event) { for _, listener := range d.GetListeners(event.Name()) { - if event.(StoppableEvent) != nil && event.(StoppableEvent).IsPropagationStopped() { + if e, ok := event.(StoppableEvent); ok && e.IsPropagationStopped() { return }