Skip to content

Commit

Permalink
fix nil deref when format version missing in exo file
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonbloom committed Nov 15, 2021
1 parent 44bb175 commit 41b229d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/manifest/exohcl/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ func NewFormatVersion(m *Manifest) *FormatVersion {
}

func (ver *FormatVersion) Analyze(ctx *AnalysisContext) {
if ver.Attribute == nil {
ctx.AppendDiags(&hcl.Diagnostic{
Severity: hcl.DiagError,
Summary: "exo version attribute is required",
})
return
}
s, diag := parseLiteralString(ver.Attribute.Expr)
if diag != nil {
ctx.AppendDiags(diag)
Expand Down

0 comments on commit 41b229d

Please sign in to comment.