Fixed null pointer issue in ExportCSV command