Skip to content

Commit

Permalink
fix: do not crash when the algorithm option return non Buffer (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Sep 2, 2020
1 parent 4ede778 commit 81bf601
Show file tree
Hide file tree
Showing 14 changed files with 632 additions and 279 deletions.
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ class CompressionPlugin {
return reject(error);
}

if (!Buffer.isBuffer(result)) {
// eslint-disable-next-line no-param-reassign
result = Buffer.from(result);
}

return resolve(result);
});
});
Expand Down
Loading

0 comments on commit 81bf601

Please sign in to comment.