Fix crasher

Signed-off-by: dubo-dubon-duponey <dubodubonduponey+github@pm.me>
This commit is contained in:
dubo-dubon-duponey 2021-05-12 15:47:20 -07:00
parent d3f3799976
commit e9968e4c90
No known key found for this signature in database
GPG Key ID: C3B96779C681DA56

View File

@ -57,6 +57,11 @@ func Build(sources map[string]fs.FS, args ...string) (*Value, error) {
if len(instances) != 1 { if len(instances) != 1 {
return nil, errors.New("only one package is supported at a time") return nil, errors.New("only one package is supported at a time")
} }
for _, value := range instances {
if value.Err != nil {
return nil, value.Err
}
}
v, err := c.Context.BuildInstances(instances) v, err := c.Context.BuildInstances(instances)
if err != nil { if err != nil {
return nil, errors.New(cueerrors.Details(err, &cueerrors.Config{})) return nil, errors.New(cueerrors.Details(err, &cueerrors.Config{}))