fixing null reference in yarn.lock check (#3444)

This commit is contained in:
Brandon Black
2017-01-31 14:45:22 -08:00
committed by GitHub
parent 47b109be36
commit 3719214aba

View File

@@ -486,6 +486,7 @@ module Linguist
# Returns true or false.
def generated_yarn_lock?
return false unless name.match(/yarn\.lock/)
return false unless lines.count > 0
return lines[0].include?("# THIS IS AN AUTOGENERATED FILE")
end
end