From 24fb5694dbde2c7f06bc8a9ae296aaec03f8afc3 Mon Sep 17 00:00:00 2001 From: tamireran Date: Thu, 6 Aug 2015 09:59:32 +0300 Subject: [PATCH] fix for small uploads --- src/server/object_mapper.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/object_mapper.js b/src/server/object_mapper.js index 1da9a2fe37..568ec97921 100644 --- a/src/server/object_mapper.js +++ b/src/server/object_mapper.js @@ -263,8 +263,13 @@ function allocate_object_parts(bucket, obj, parts) { function finalize_object_parts(bucket, obj, parts) { var block_ids = _.flatten(_.map(parts, 'block_ids')); var chunks; - var upload_part_number = (parts[0].upload_part_number ? parts[0].upload_part_number : null); - dbg.log1('finalize_object_parts', upload_part_number); + var upload_part_number = null; + if (parts && parts[0] && !_.isUndefined(parts[0].upload_part_number)) { + dbg.log1('update upload part number with', parts[0].upload_part_number); + upload_part_number = parts[0].upload_part_number; + } + dbg.log1('finalize_object_parts', upload_part_number, parts[0].upload_part_number, parts); + return Q.all([ // find parts by start offset, deleted parts are handled later