summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-03-14 21:10:25 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-03-15 10:39:33 +0100
commit508e08410b3e87f28dc5f647f673ad6a651c65a1 (patch)
tree66688571bb51e03d203b8e4e3c015d23b88c4c53 /libpod
parent39859850aec4d0d3fe8bcf7804f6f02a245e2b6e (diff)
downloadpodman-508e08410b3e87f28dc5f647f673ad6a651c65a1.tar.gz
podman-508e08410b3e87f28dc5f647f673ad6a651c65a1.tar.bz2
podman-508e08410b3e87f28dc5f647f673ad6a651c65a1.zip
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 <gscrivan@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_internal.go12
1 files 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)