diff --git a/lib/storage/file.js b/lib/storage/file.js index 4f7cf54a6..65ff86bac 100644 --- a/lib/storage/file.js +++ b/lib/storage/file.js @@ -59,7 +59,8 @@ var channelExists = function (filepath, cb) { }; const destroyStream = function (stream) { - stream.close(); + if (!stream) { return; } + try { stream.close(); } catch (err) { console.error(err); } setTimeout(function () { try { stream.destroy(); } catch (err) { console.log(err); } }, 5000);