From a7dafe8a51d750471ae664d35b1ada2ec11b81bf Mon Sep 17 00:00:00 2001 From: Longshou Situ Date: Mon, 9 Oct 2023 09:15:20 -0700 Subject: [PATCH] Avoid NoMethodError in Bulkrax::Importers::Controller#create. --- app/parsers/bulkrax/csv_parser.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/parsers/bulkrax/csv_parser.rb b/app/parsers/bulkrax/csv_parser.rb index d859390d..f7e34dda 100644 --- a/app/parsers/bulkrax/csv_parser.rb +++ b/app/parsers/bulkrax/csv_parser.rb @@ -33,9 +33,10 @@ def build_records model_field_mappings.map(&:to_sym).each do |model_mapping| next unless r.key?(model_mapping) - if r[model_mapping].strip.casecmp('collection').zero? + model = r[model_mapping].nil? ? "" : r[model_mapping].strip + if model.casecmp('collection').zero? @collections << r - elsif r[model_mapping].strip.casecmp('fileset').zero? + elsif model.casecmp('fileset').zero? @file_sets << r else @works << r