kylefarris / clamscan

A robust ClamAV virus scanning library supporting scanning files, directories, and streams with local sockets, local/remote TCP, and local clamscan/clamdscan binaries (with failover).
MIT License
236 stars 69 forks source link

Error thrown using clamdscan with scan_recursively false #11

Closed taietel closed 9 years ago

taietel commented 9 years ago

I'm using the default config, the only changes are to the clamdscan config_file and scan_recursively which is set to false so I can get the lists with good / bad files. This is the error that I get:

/var/www/aws-cleaner/node_modules/clamscan/index.js:535
                        if (info.isFile()) good_files.push(file);
                                ^

TypeError: Cannot read property 'isFile' of undefined
    at /var/www/aws-cleaner/node_modules/clamscan/index.js:535:33
    at FSReqWrap.oncomplete (fs.js:82:15)

It works fine using the other 'option' to get the 2 lists with good/bad files, using a file_cb function and scan_recursively set to true.

kylefarris commented 9 years ago

Thanks for the bug report @taietel. I'll take a look at it and see what's going on.

kylefarris commented 9 years ago

Alright, the bug's been patched by the following commit: 441c5a65ec7dea433bb4d2f2535dfee2556aa08d

Thanks again for the bug report and sorry for the inconvenience!

BTW, make sure to update your project to use version 0.8.4 of this clamscan module!