diff --git a/app/serializers/core_data_connector/public/user_defined_serializer.rb b/app/serializers/core_data_connector/public/user_defined_serializer.rb index 83e08f9..d4a7f5a 100644 --- a/app/serializers/core_data_connector/public/user_defined_serializer.rb +++ b/app/serializers/core_data_connector/public/user_defined_serializer.rb @@ -29,6 +29,8 @@ def render_user_defined(item, fields, hash) return if fields.nil? fields.each do |field| + next unless item.user_defined + value = item.user_defined[field.uuid] next if value.nil? @@ -40,4 +42,4 @@ def render_user_defined(item, fields, hash) end end end -end \ No newline at end of file +end diff --git a/app/services/core_data_connector/search/base.rb b/app/services/core_data_connector/search/base.rb index fdca1a3..53e08bf 100644 --- a/app/services/core_data_connector/search/base.rb +++ b/app/services/core_data_connector/search/base.rb @@ -373,6 +373,8 @@ def build_user_defined(record, user_defined_fields) hash = {} user_defined_fields.each do |field| + next unless record.user_defined + value = record.user_defined[field.uuid] next unless value.present?