Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,23 @@ Tail = (function(_super) {
};

if (self.fd) {
fs.close(self.fd);
/**
* Fix for TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined,
* when unwatch() is called on tail object
*/
fs.close(self.fd, function() {});
self.fd = null;
};

// close any legacy fds
for (var i in self.queue) {
var item = self.queue[i];
if (item.type == 'close') {
fs.close(item.fd);
/**
* Fix for TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined,
* when unwatch() is called on tail object
*/
fs.close(item.fd, function() {});
};
};

Expand Down