fix null data handling error

If you download the file with nonexistent result file(query result is nothing), the following error occurs.

events.js:72
        throw er; // Unhandled 'error' event