diff --git a/tests/integration/longhorn/longhorn_int_test.go b/tests/integration/longhorn/longhorn_int_test.go index 7bade6cc222a..e4c475e71605 100644 --- a/tests/integration/longhorn/longhorn_int_test.go +++ b/tests/integration/longhorn/longhorn_int_test.go @@ -139,7 +139,7 @@ var _ = AfterEach(func() { }) var _ = AfterSuite(func() { - if !testutil.IsExistingServer() { + if !testutil.IsExistingServer() && server != nil { if failed { testutil.K3sSaveLog(server, false) }