You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the path does not exist, instead of it being caught by the .catch() call, this happens:
$ node webarchive.js
/Users/.../node_modules/bplist-parser/bplistParser.js:46
return callback(err);
^
TypeError: callback is not a function
at ReadFileContext.callback (/Users/martin/.../node_modules/bplist-parser/bplistParser.js:46:16)
at FSReqCallback.readFileAfterOpen [as oncomplete] (node:fs:324:13)
Node.js v18.12.1
This is caused by an oversight in the function's code:
Given the following sample code:
If the path does not exist, instead of it being caught by the
.catch()
call, this happens:This is caused by an oversight in the function's code:
When the call to
readFile()
fails, the code rejects the promise and assumes the callback exists, when it might not.Conversely, a few lines above, this is handled differently, where the buffers are read:
A PR with a fix will follow this bug report.
The text was updated successfully, but these errors were encountered: