Skip to content

Commit

Permalink
container: check containerInfo.Config before accessing it
Browse files Browse the repository at this point in the history
check that containerInfo.Config is not nil before trying to access
it.

Closes: containers#2654

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Mar 15, 2019
1 parent 3985985 commit 508e084
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions libpod/container_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 508e084

Please sign in to comment.