Skip to content

Commit

Permalink
Non-existant file just comes back empty from S3, handle it
Browse files Browse the repository at this point in the history
  • Loading branch information
mgarbacz committed Aug 7, 2014
1 parent 3e68379 commit 05a0110
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ exports.getFile = function(fileName, callback) {
var s3 = new aws.S3();
var data = { Key: fileName, Bucket: 'wotf-cyoa' };
s3.getObject(data, function(err, data) {
callback(err, data.Body);
if (data === null) callback (true, false);
else callback(err, data.Body);
});
};

0 comments on commit 05a0110

Please sign in to comment.