server: add nil checks to not panic
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
5ed79fb5cd
commit
404194c1fd
3 changed files with 14 additions and 2 deletions
|
@ -678,6 +678,11 @@ func (s *Server) GetSandboxContainer(id string) *oci.Container {
|
|||
return sb.infraContainer
|
||||
}
|
||||
|
||||
// GetContainer returns a container by its ID
|
||||
func (s *Server) GetContainer(id string) *oci.Container {
|
||||
return s.getContainer(id)
|
||||
}
|
||||
|
||||
func (s *Server) removeContainer(c *oci.Container) {
|
||||
s.stateLock.Lock()
|
||||
sandbox := s.state.sandboxes[c.Sandbox()]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue