Skip to content

Commit df3df26

Browse files
committed
Fixes #19. Callback in mv method is optional
1 parent 568f211 commit df3df26

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ module.exports = function(options) {
4949
safeFileNameRegex = options.safeFileNames;
5050

5151
filename = filename.replace(safeFileNameRegex, '');
52-
53-
console.log('filename yo', filename);
5452
}
5553

5654
var newFile = {
@@ -63,10 +61,12 @@ module.exports = function(options) {
6361
fstream = fs.createWriteStream(path);
6462
streamifier.createReadStream(buf).pipe(fstream);
6563
fstream.on('error', function(error) {
66-
callback(error);
64+
if (callback)
65+
callback(error);
6766
});
6867
fstream.on('close', function() {
69-
callback(null);
68+
if (callback)
69+
callback(null);
7070
});
7171
}
7272
};

0 commit comments

Comments
 (0)