From bfd4775dbe9e4efee4604419bd55576486384ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20P=C3=A9rez?= Date: Wed, 11 Sep 2024 09:04:19 +0200 Subject: [PATCH] nil check --- internals/daemon/daemon.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internals/daemon/daemon.go b/internals/daemon/daemon.go index 6e7684c3..f5df4402 100644 --- a/internals/daemon/daemon.go +++ b/internals/daemon/daemon.go @@ -687,8 +687,10 @@ func (d *Daemon) doReboot(sigCh chan<- os.Signal, waitTimeout time.Duration) err return err } - if err := d.rebootCleanup(); err != nil { - return err + if d.rebootCleanup != nil { + if err := d.rebootCleanup(); err != nil { + return err + } } // ask for shutdown and wait for it to happen.