lib/pre-commit/checks/js_check.rb in pre-commit-0.1.13 vs lib/pre-commit/checks/js_check.rb in pre-commit-0.1.14
- old
+ new
@@ -49,9 +49,11 @@
def linter_src
raise "Must be defined by subclass"
end
def display_error(error_object, file)
+ return "" unless error_object
+
line = error_object['line'].to_i + 1
"pre-commit: #{check_name.upcase} #{error_object['reason']}\n#{file}:#{line} #{error_object['evidence']}"
end
end