Fix a crash when trying to export records when no records where available.