feat: add storageEventListener nil check
Only shutdown the storageEventListener if the storageEventListener is not nil
This commit is contained in:
1 parent
fae2149990
commit
a23c57e7c6
1 file changed
+5
-3
@@ -712,9 +712,11 @@ func (w *Worker) Shutdown() error {
|
||||
ar.SetAddresses(nil)
|
||||
}
|
||||
|
||||
err := w.storageEventListener.Shutdown(w.baseContext)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error shutting down worker event listener: %w", err)
|
||||
if w.storageEventListener != nil {
|
||||
err := w.storageEventListener.Shutdown(w.baseContext)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error shutting down worker event listener: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
w.started.Store(false)
|
||||
|
||||
Reference in new issue
Block a user