Skip to content

Commit 0b83aa1

Browse files
authored
Merge pull request moby#51943 from vvoland/init-fix-panic
daemon: Fix panic in shutdown after daemon init fails
2 parents 9c62384 + 1200f5e commit 0b83aa1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

daemon/events/events.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ func (e *Events) loadBufferedEvents(since, until time.Time, topic func(any) bool
154154

155155
// Close all the channels returned to event subscribers.
156156
func (e *Events) Close() error {
157+
if e == nil || e.pub == nil {
158+
return nil
159+
}
157160
e.pub.Close()
158161
return nil
159162
}

0 commit comments

Comments
 (0)