Catch a missing err check in apply command

Plan and refresh already had this, but apply would deref a nil opReq and panic.
pull/34914/head
Nick Fagerlund 2 years ago
parent 1781c8e8e9
commit dc9a13a975

@ -107,6 +107,10 @@ func (c *ApplyCommand) Run(rawArgs []string) int {
// Build the operation request
opReq, opDiags := c.OperationRequest(be, view, args.ViewType, planFile, args.Operation, args.AutoApprove)
diags = diags.Append(opDiags)
if diags.HasErrors() {
view.Diagnostics(diags)
return 1
}
// Collect variable value and add them to the operation request
diags = diags.Append(c.GatherVariables(opReq, args.Vars))

Loading…
Cancel
Save