Skip to content

Commit

Permalink
fix: check if file exists before removing them #26
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Karres committed Aug 20, 2021
1 parent a51ad54 commit 243e269
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/build/Lame.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/Lame.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/src/Lame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,11 @@ class Lame {
* Remove temp files, if error occurred
*/
private removeTempFilesOnError() {
if (this.fileBufferTempFilePath != undefined) {
if (this.fileBufferTempFilePath != undefined && fsExistsSync(this.fileBufferTempFilePath)) {
fsUnlinkSync(this.fileBufferTempFilePath);
}

if (this.progressedBufferTempFilePath != undefined) {
if (this.progressedBufferTempFilePath != undefined && fsExistsSync(this.progressedBufferTempFilePath)) {
fsUnlinkSync(this.progressedBufferTempFilePath);
}
}
Expand Down

0 comments on commit 243e269

Please sign in to comment.