Skip to content

Commit

Permalink
Avoid segfault on pull image when remote is unreachable
Browse files Browse the repository at this point in the history
  • Loading branch information
geaaru committed Sep 9, 2024
1 parent e5d459c commit 5364bb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/executor/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@ func (e *LxdCExecutor) PullImage(imageAlias, imageRemoteServer string) (string,
"For image "+imageAlias+" found fingerprint "+imageFingerprint)
}

if e.LxdClient == nil {
return "", fmt.Errorf("Something goes wrong on initialize client.")
}

// Check if image is already present locally else we receive an error.
image, _, _ := e.LxdClient.GetImage(imageFingerprint)
if image == nil {
Expand Down

0 comments on commit 5364bb5

Please sign in to comment.