Skip to content

Commit

Permalink
internal/util/yamlutil: fix empty yaml bug (operator-framework#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 operator-framework#1225
  • Loading branch information
AlexNPavel committed Apr 1, 2019
1 parent 43f4ecc commit d0f2fcb
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 d0f2fcb

Please sign in to comment.