If exportFileName hook isn’t defined don’t return empty filename.

This commit should fix #2251.

If ``exportFileName`` hook is not defined, ``hookFileName`` should be an empty array. Test the length of ``hookFileName`` before overriding ``fileName``, the export filename.