Skip to content

Commit

Permalink
avoid panic by checking before dereferencing
Browse files Browse the repository at this point in the history
  • Loading branch information
siliconbrain committed Nov 19, 2021
1 parent 4d10a06 commit 74e68b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/internal/testing/controlplane/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,10 @@ func (s *APIServer) populateAPIServerCerts() error {
// Stop stops this process gracefully, waits for its termination, and cleans up
// the CertDir if necessary.
func (s *APIServer) Stop() error {
if s.processState.DirNeedsCleaning {
s.CertDir = "" // reset the directory if it was randomly allocated, so that we can safely restart
}
if s.processState != nil {
if s.processState.DirNeedsCleaning {
s.CertDir = "" // reset the directory if it was randomly allocated, so that we can safely restart
}
if err := s.processState.Stop(); err != nil {
return err
}
Expand Down

0 comments on commit 74e68b5

Please sign in to comment.