should flash notice when exporting no records.
[#1824] small refactoring around conditionals