diff --git a/lib/build/Lame.js b/lib/build/Lame.js index 6b1b292..fa6d901 100644 --- a/lib/build/Lame.js +++ b/lib/build/Lame.js @@ -334,10 +334,10 @@ class Lame { * Remove temp files, if error occurred */ removeTempFilesOnError() { - if (this.fileBufferTempFilePath != undefined) { + if (this.fileBufferTempFilePath != undefined && fs_1.existsSync(this.fileBufferTempFilePath)) { fs_1.unlinkSync(this.fileBufferTempFilePath); } - if (this.progressedBufferTempFilePath != undefined) { + if (this.progressedBufferTempFilePath != undefined && fs_1.existsSync(this.progressedBufferTempFilePath)) { fs_1.unlinkSync(this.progressedBufferTempFilePath); } } diff --git a/lib/build/Lame.js.map b/lib/build/Lame.js.map index 4b876a6..522d72b 100644 --- a/lib/build/Lame.js.map +++ b/lib/build/Lame.js.map @@ -1 +1 @@ -{"version":3,"file":"Lame.js","sourceRoot":"","sources":["../src/Lame.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAC5C,2BAKY;AACZ,+BAAgD;AAChD,iDAAsC;AACtC,mCAAsC;AAEtC;;;;GAIG;AACH,MAAM,IAAI;IAoBN;;;OAGG;IACH,YAAY,OAAgB;QAvBpB,WAAM,GAAe;YACzB,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,SAAS;YACnB,GAAG,EAAE,SAAS;SACjB,CAAC;QACM,YAAO,GAAiB,IAAI,qBAAY,EAAE,CAAC;QAkB/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,CAAC;IAC7D,CAAC;IAED;;;;OAIG;IACI,OAAO,CAAC,IAAY;QACvB,IAAI,CAAC,eAAY,CAAC,IAAI,CAAC,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACvD;QAED,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,UAA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qBAAqB,CACzB,IAAuB,EACvB,YAAiC;QAEjC,MAAM,MAAM,GAAG,GAAG,SAAS,OAAO,CAAC;QACnC,IAAI,IAAI,GAAG,GAAG,MAAM,UAAU,IAAI,GAAG,CAAC;QACtC,IAAI,QAAQ,GACR,gEAAgE,CAAC;QAErE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;YACzB,IAAI,IAAI,QAAQ,CAAC,MAAM,CACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAC9C,CAAC;SACL;QAED,IAAI,IAAI,IAAI,KAAK,IAAI,YAAY,IAAI,QAAQ,EAAE;YAC3C,IAAI,IAAI,MAAM,CAAC;SAClB;QAED,IAAI,CAAC,eAAY,CAAC,GAAG,MAAM,UAAU,IAAI,EAAE,CAAC,EAAE;YAC1C,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,IAAI,CAAC,qBAAqB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;SACzD;IACL,CAAC;IAED;;OAEG;IACK,sBAAsB;QAC1B,IAAI,IAAI,CAAC,sBAAsB,IAAI,SAAS,IAAI,eAAY,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAAE;YACvF,eAAY,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;SAC7C;QAED,IAAI,IAAI,CAAC,4BAA4B,IAAI,SAAS,IAAI,eAAY,CAAC,IAAI,CAAC,4BAA4B,CAAC,EAAE;YACnG,eAAY,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;SACnD;IACL,CAAC;CACJ;AAEQ,oBAAI"} \ No newline at end of file diff --git a/lib/src/Lame.ts b/lib/src/Lame.ts index 5583be3..faf9eac 100644 --- a/lib/src/Lame.ts +++ b/lib/src/Lame.ts @@ -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); } }