Commit f27f0b623296ec790fc2ff7f77e74adb1946697a
1 parent
812b38b1
Exists in
master
and in
21 other branches
Do not try to import empty records array
Showing
1 changed file
with
1 additions
and
0 deletions
Show diff stats
lib/searchkick/logging.rb
@@ -38,6 +38,7 @@ module Searchkick | @@ -38,6 +38,7 @@ module Searchkick | ||
38 | alias_method_chain :remove, :instrumentation | 38 | alias_method_chain :remove, :instrumentation |
39 | 39 | ||
40 | def import_with_instrumentation(records) | 40 | def import_with_instrumentation(records) |
41 | + return unless records.any? | ||
41 | event = { | 42 | event = { |
42 | name: "#{records.first.searchkick_klass.name} Import", | 43 | name: "#{records.first.searchkick_klass.name} Import", |
43 | count: records.size | 44 | count: records.size |