mirror of
https://github.com/moby/moby.git
synced 2026-01-11 02:31:44 +00:00
Merge pull request #51797 from lujinda/fix_shutdown_panic
fix: prevent potential panic in Shutdown when EventsService is nil
This commit is contained in:
@@ -1498,7 +1498,9 @@ func (daemon *Daemon) Shutdown(ctx context.Context) error {
|
||||
// running anymore. If there are still some open connections to the
|
||||
// '/events' endpoint, closing the EventsService should tear them down
|
||||
// immediately.
|
||||
daemon.EventsService.Close()
|
||||
if daemon.EventsService != nil {
|
||||
daemon.EventsService.Close()
|
||||
}
|
||||
|
||||
return daemon.cleanupMounts(cfg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user