Skip to content

Commit

Permalink
prevent panic with empty document
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <[email protected]>
  • Loading branch information
ndeloof committed Sep 12, 2023
1 parent f02a580 commit 2a83d1c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ func load(ctx context.Context, configDetails types.ConfigDetails, opts *Options,
}
}

if model == nil {
return nil, errors.New("empty compose file")
}

project := &types.Project{
Name: opts.projectName,
WorkingDir: configDetails.WorkingDir,
Expand Down

0 comments on commit 2a83d1c

Please sign in to comment.