Skip to content

Commit

Permalink
Don't error when file is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
crdx committed May 12, 2024
1 parent 9fb111e commit e24f08d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/docwatch/parser/frontmatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Parser::Frontmatter < Parser
def self.split(str)
lines = str.lines

if lines.first.chomp != '---'
if lines.length == 0 || lines.first.chomp != '---'
return [nil, str]
end

Expand Down

0 comments on commit e24f08d

Please sign in to comment.