Skip to content

Commit

Permalink
Fix the problem reported in kylefarris#102
Browse files Browse the repository at this point in the history
Proper error handling in scanStream method.
  • Loading branch information
benzino77 committed Aug 10, 2022
1 parent 51612ad commit beab5e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2281,6 +2281,9 @@ class NodeClam {
if (this.settings.debugMode)
console.log(`${this.debugLabel}: Raw Response: ${response.toString('utf8')} `);
const result = this._processResult(response.toString('utf8'), null);
if (result instanceof Error) {
return hasCb ? cb(result, null) : reject(result);
}
return hasCb ? cb(null, result) : resolve(result);
});
} catch (err) {
Expand Down

0 comments on commit beab5e5

Please sign in to comment.