moved the done function up out of the getStatHandler function and in to the file method as if node-dir.paths() was called on an empty folder it attempted to call done outside of the getStatHandler function so couldn't get access to the done method. Had to add in some error handling to the done function to handle a null argument being passed as a result..... think it's all correct :s
Don't need to pass in results to doen as they are available within the function already - also means no need to error check anything so effectively I have just moved the done function as a whole so it is available everywhere it is called from
Merge pull request #2 from coulson84/master

Fixing error when calling files method on an empty directory.