@@ -529,6 +529,11 @@ public List<PartETag> PartETags
529
529
/// <param name="partETags">PartETags that will added to this request.</param>
530
530
public void AddPartETags ( params PartETag [ ] partETags )
531
531
{
532
+ if ( PartETags == null )
533
+ {
534
+ PartETags = new List < PartETag > ( ) ;
535
+ }
536
+
532
537
if ( partETags != null )
533
538
{
534
539
foreach ( PartETag part in partETags )
@@ -544,13 +549,17 @@ public void AddPartETags(params PartETag[] partETags)
544
549
/// <param name="partETags">PartETags that will added to this request.</param>
545
550
public void AddPartETags ( IEnumerable < PartETag > partETags )
546
551
{
547
- if ( partETags == null )
552
+ if ( PartETags == null )
548
553
{
549
- partETags = new List < PartETag > ( ) ;
554
+ PartETags = new List < PartETag > ( ) ;
550
555
}
551
- foreach ( PartETag part in partETags )
556
+
557
+ if ( partETags != null )
552
558
{
553
- this . PartETags . Add ( part ) ;
559
+ foreach ( PartETag part in partETags )
560
+ {
561
+ this . PartETags . Add ( part ) ;
562
+ }
554
563
}
555
564
}
556
565
@@ -568,9 +577,12 @@ public void AddPartETags(params UploadPartResponse[] responses)
568
577
PartETags = new List < PartETag > ( ) ;
569
578
}
570
579
571
- foreach ( UploadPartResponse response in responses )
580
+ if ( responses != null )
572
581
{
573
- this . PartETags . Add ( new PartETag ( response , copyChecksums : false ) ) ;
582
+ foreach ( UploadPartResponse response in responses )
583
+ {
584
+ this . PartETags . Add ( new PartETag ( response , copyChecksums : false ) ) ;
585
+ }
574
586
}
575
587
}
576
588
@@ -588,9 +600,12 @@ public void AddPartETags(IEnumerable<UploadPartResponse> responses)
588
600
PartETags = new List < PartETag > ( ) ;
589
601
}
590
602
591
- foreach ( UploadPartResponse response in responses )
603
+ if ( responses != null )
592
604
{
593
- this . PartETags . Add ( new PartETag ( response , copyChecksums : false ) ) ;
605
+ foreach ( UploadPartResponse response in responses )
606
+ {
607
+ this . PartETags . Add ( new PartETag ( response , copyChecksums : false ) ) ;
608
+ }
594
609
}
595
610
}
596
611
@@ -605,9 +620,12 @@ public void AddPartETagsAndChecksums(params UploadPartResponse[] responses)
605
620
PartETags = new List < PartETag > ( ) ;
606
621
}
607
622
608
- foreach ( UploadPartResponse response in responses )
623
+ if ( responses != null )
609
624
{
610
- this . PartETags . Add ( new PartETag ( response , copyChecksums : true ) ) ;
625
+ foreach ( UploadPartResponse response in responses )
626
+ {
627
+ this . PartETags . Add ( new PartETag ( response , copyChecksums : true ) ) ;
628
+ }
611
629
}
612
630
}
613
631
@@ -622,9 +640,12 @@ public void AddPartETagsAndChecksums(IEnumerable<UploadPartResponse> responses)
622
640
PartETags = new List < PartETag > ( ) ;
623
641
}
624
642
625
- foreach ( UploadPartResponse response in responses )
643
+ if ( responses != null )
626
644
{
627
- this . PartETags . Add ( new PartETag ( response , copyChecksums : true ) ) ;
645
+ foreach ( UploadPartResponse response in responses )
646
+ {
647
+ this . PartETags . Add ( new PartETag ( response , copyChecksums : true ) ) ;
648
+ }
628
649
}
629
650
}
630
651
@@ -642,9 +663,12 @@ public void AddPartETags(params CopyPartResponse[] responses)
642
663
PartETags = new List < PartETag > ( ) ;
643
664
}
644
665
645
- foreach ( CopyPartResponse response in responses )
666
+ if ( responses != null )
646
667
{
647
- this . PartETags . Add ( new PartETag ( response , copyChecksums : false ) ) ;
668
+ foreach ( CopyPartResponse response in responses )
669
+ {
670
+ this . PartETags . Add ( new PartETag ( response , copyChecksums : false ) ) ;
671
+ }
648
672
}
649
673
}
650
674
@@ -662,9 +686,12 @@ public void AddPartETags(IEnumerable<CopyPartResponse> responses)
662
686
PartETags = new List < PartETag > ( ) ;
663
687
}
664
688
665
- foreach ( CopyPartResponse response in responses )
689
+ if ( responses != null )
666
690
{
667
- this . PartETags . Add ( new PartETag ( response , copyChecksums : false ) ) ;
691
+ foreach ( CopyPartResponse response in responses )
692
+ {
693
+ this . PartETags . Add ( new PartETag ( response , copyChecksums : false ) ) ;
694
+ }
668
695
}
669
696
}
670
697
@@ -679,9 +706,12 @@ public void AddPartETagsAndChecksums(params CopyPartResponse[] responses)
679
706
PartETags = new List < PartETag > ( ) ;
680
707
}
681
708
682
- foreach ( CopyPartResponse response in responses )
709
+ if ( responses != null )
683
710
{
684
- this . PartETags . Add ( new PartETag ( response , copyChecksums : true ) ) ;
711
+ foreach ( CopyPartResponse response in responses )
712
+ {
713
+ this . PartETags . Add ( new PartETag ( response , copyChecksums : true ) ) ;
714
+ }
685
715
}
686
716
}
687
717
@@ -696,9 +726,12 @@ public void AddPartETagsAndChecksums(IEnumerable<CopyPartResponse> responses)
696
726
PartETags = new List < PartETag > ( ) ;
697
727
}
698
728
699
- foreach ( CopyPartResponse response in responses )
729
+ if ( responses != null )
700
730
{
701
- this . PartETags . Add ( new PartETag ( response , copyChecksums : true ) ) ;
731
+ foreach ( CopyPartResponse response in responses )
732
+ {
733
+ this . PartETags . Add ( new PartETag ( response , copyChecksums : true ) ) ;
734
+ }
702
735
}
703
736
}
704
737
0 commit comments