Skip to content

Commit

Permalink
check exists before unlink
Browse files Browse the repository at this point in the history
  • Loading branch information
algv committed Jun 4, 2018
1 parent 55dd3f6 commit 6122633
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/utils/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ namespace trusted.utils {
});

sendReq.on("error", (err) => {
fs.unlink(path);
if (fs.existsSync(path)) {
fs.unlink(path);
}

done(err);
});
}
Expand Down

0 comments on commit 6122633

Please sign in to comment.