diff --git a/app/services/bulk_upload/lettings/year2022/row_parser.rb b/app/services/bulk_upload/lettings/year2022/row_parser.rb index 6c86e8dd1..44e10ac0b 100644 --- a/app/services/bulk_upload/lettings/year2022/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2022/row_parser.rb @@ -513,7 +513,7 @@ private end def created_by - @created_by ||= User.where("lower(email) = ?", field_112.downcase).first + @created_by ||= User.where("lower(email) = ?", field_112&.downcase).first end def duplicate_check_fields diff --git a/app/services/bulk_upload/lettings/year2023/row_parser.rb b/app/services/bulk_upload/lettings/year2023/row_parser.rb index 7ece50a20..9614c19bb 100644 --- a/app/services/bulk_upload/lettings/year2023/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2023/row_parser.rb @@ -542,7 +542,7 @@ private end def created_by - @created_by ||= User.where("lower(email) = ?", field_3.downcase).first + @created_by ||= User.where("lower(email) = ?", field_3&.downcase).first end def validate_uprn_exists_if_any_key_address_fields_are_blank diff --git a/app/services/bulk_upload/sales/year2022/row_parser.rb b/app/services/bulk_upload/sales/year2022/row_parser.rb index 0f1dfa17f..55f5f0ed1 100644 --- a/app/services/bulk_upload/sales/year2022/row_parser.rb +++ b/app/services/bulk_upload/sales/year2022/row_parser.rb @@ -934,7 +934,7 @@ private end def created_by - @created_by ||= User.where("lower(email) = ?", field_93.downcase).first + @created_by ||= User.where("lower(email) = ?", field_93&.downcase).first end def hhregres diff --git a/app/services/bulk_upload/sales/year2023/row_parser.rb b/app/services/bulk_upload/sales/year2023/row_parser.rb index 62c9c230b..6ce207abf 100644 --- a/app/services/bulk_upload/sales/year2023/row_parser.rb +++ b/app/services/bulk_upload/sales/year2023/row_parser.rb @@ -1112,7 +1112,7 @@ private end def created_by - @created_by ||= User.where("lower(email) = ?", field_2.downcase).first + @created_by ||= User.where("lower(email) = ?", field_2&.downcase).first end def previous_la_known