Skip to content

Commit 4621d1e

Browse files
committed
Merge pull request #461 from noobaa/eran_alpha_updates
fix for small uploads
2 parents fe869c9 + 24fb569 commit 4621d1e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/server/object_mapper.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,13 @@ function allocate_object_parts(bucket, obj, parts) {
263263
function finalize_object_parts(bucket, obj, parts) {
264264
var block_ids = _.flatten(_.map(parts, 'block_ids'));
265265
var chunks;
266-
var upload_part_number = (parts[0].upload_part_number ? parts[0].upload_part_number : null);
267-
dbg.log1('finalize_object_parts', upload_part_number);
266+
var upload_part_number = null;
267+
if (parts && parts[0] && !_.isUndefined(parts[0].upload_part_number)) {
268+
dbg.log1('update upload part number with', parts[0].upload_part_number);
269+
upload_part_number = parts[0].upload_part_number;
270+
}
271+
dbg.log1('finalize_object_parts', upload_part_number, parts[0].upload_part_number, parts);
272+
268273
return Q.all([
269274

270275
// find parts by start offset, deleted parts are handled later

0 commit comments

Comments
 (0)