From 508e08410b3e87f28dc5f647f673ad6a651c65a1 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 14 Mar 2019 21:10:25 +0100 Subject: container: check containerInfo.Config before accessing it check that containerInfo.Config is not nil before trying to access it. Closes: https://github.com/containers/libpod/issues/2654 Signed-off-by: Giuseppe Scrivano --- libpod/container_internal.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libpod/container_internal.go b/libpod/container_internal.go index bea7acd69..872802016 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -337,11 +337,13 @@ func (c *Container) setupStorage(ctx context.Context) error { } // Set the default Entrypoint and Command - if c.config.Entrypoint == nil { - c.config.Entrypoint = containerInfo.Config.Config.Entrypoint - } - if c.config.Command == nil { - c.config.Command = containerInfo.Config.Config.Cmd + if containerInfo.Config != nil { + if c.config.Entrypoint == nil { + c.config.Entrypoint = containerInfo.Config.Config.Entrypoint + } + if c.config.Command == nil { + c.config.Command = containerInfo.Config.Config.Cmd + } } artifacts := filepath.Join(c.config.StaticDir, artifactsDir) -- cgit v1.2.3-54-g00ecf