Skip to content

Commit

Permalink
internal/util/yamlutil: fix empty yaml bug (#1258)
Browse files Browse the repository at this point in the history
**Description of the change:** Check length of yaml token after trimming spaces


**Motivation for the change:** Fix #1225
  • Loading branch information
AlexNPavel authored Mar 28, 2019
1 parent 89120f4 commit 5a439ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/util/yamlutil/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (s *Scanner) Scan() bool {
s.err = err
return false
}
if tok == nil {
if len(bytes.TrimSpace(tok)) == 0 {
s.empties++
if s.empties > maxExecutiveEmpties {
panic("yaml.Scan: too many empty tokens without progressing")
Expand Down

0 comments on commit 5a439ae

Please sign in to comment.