diff --git a/lib/rails_admin/support/csv_converter.rb b/lib/rails_admin/support/csv_converter.rb
index <HASH>..<HASH> 100644
--- a/lib/rails_admin/support/csv_converter.rb
+++ b/lib/rails_admin/support/csv_converter.rb
@@ -4,6 +4,9 @@ require 'csv'
 module RailsAdmin
   class CSVConverter
     def initialize(objects = [], schema = {})
+      @fields = []
+      @associations = []
+
       return self if (@objects = objects).blank?
 
       @model = objects.dup.first.class
diff --git a/spec/rails_admin/support/csv_converter_spec.rb b/spec/rails_admin/support/csv_converter_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/rails_admin/support/csv_converter_spec.rb
+++ b/spec/rails_admin/support/csv_converter_spec.rb
@@ -112,5 +112,14 @@ describe RailsAdmin::CSVConverter do
         end
       end
     end
+
+    context "when objects is empty" do
+      let(:objects) { [] }
+      let(:options) { {} }
+
+      it "generates an empty csv" do
+        expect(subject[2]).to eq("\n")
+      end
+    end
   end
 end
fixing error raised when converting an empty array/relation into csv