Merge pull request #51797 from lujinda/fix_shutdown_panic

fix: prevent potential panic in Shutdown when EventsService is nil
This commit is contained in:
Paweł Gronowski
2026-01-02 14:54:41 +00:00
committed by GitHub

View File

@@ -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)
}