From fcfc595c352a02896d7cd5b1003d721a6b618bbe Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 10 Sep 2015 09:12:49 +0100 Subject: [PATCH] Handle potential error before calling `LocalFileWriter.writeStream`. --- services/filestore/app/coffee/FileHandler.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/filestore/app/coffee/FileHandler.coffee b/services/filestore/app/coffee/FileHandler.coffee index 8803f55e22..e49c172c92 100644 --- a/services/filestore/app/coffee/FileHandler.coffee +++ b/services/filestore/app/coffee/FileHandler.coffee @@ -81,4 +81,6 @@ module.exports = _writeS3FileToDisk: (bucket, key, opts, callback)-> PersistorManager.getFileStream bucket, key, opts, (err, fileStream)-> + if err? + return callback(err) LocalFileWriter.writeStream fileStream, key, callback