Skip to content

Commit

Permalink
Fix the problem reported in #102
Browse files Browse the repository at this point in the history
Proper error handling in scanStream method.
  • Loading branch information
benzino77 authored and kylefarris committed Mar 18, 2024
1 parent 78141b8 commit 8dadf1a
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 @@ -2302,6 +2302,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 8dadf1a

Please sign in to comment.