From 317ec06dc791bfbd9eb86177b3027ca92d683b8b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 28 Oct 2022 23:30:44 +0200 Subject: Fix error when uploading malformed CSV import (#19509) --- app/validators/import_validator.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/validators') diff --git a/app/validators/import_validator.rb b/app/validators/import_validator.rb index 9f19aee2a..cbad56df6 100644 --- a/app/validators/import_validator.rb +++ b/app/validators/import_validator.rb @@ -26,6 +26,8 @@ class ImportValidator < ActiveModel::Validator when 'following' validate_following_import(import, row_count) end + rescue CSV::MalformedCSVError + import.errors.add(:data, :malformed) end private -- cgit