Skip to content

Commit

Permalink
Merge pull request #167 from mziccard/fix-bucketinfo-tobuilder
Browse files Browse the repository at this point in the history
BucketInfo: add null check for rules in builder
  • Loading branch information
aozarov committed Sep 18, 2015
2 parents 71b62e8 + 3a183e4 commit 3739a1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public Builder notFoundPage(String notFoundPage) {
}

public Builder deleteRules(Iterable<? extends DeleteRule> rules) {
this.deleteRules = ImmutableList.copyOf(rules);
this.deleteRules = rules != null ? ImmutableList.copyOf(rules) : null;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ public void testToBuilder() {
compareBuckets(BUCKET_INFO, bucketInfo);
}

@Test
public void testToBuilderIncomplete() {
BucketInfo incompleteBucketInfo = BucketInfo.builder("b").build();
assertEquals(incompleteBucketInfo.name(), incompleteBucketInfo.toBuilder().build().name());
}

@Test
public void testOf() {
BucketInfo bucketInfo = BucketInfo.of("bucket");
Expand Down

0 comments on commit 3739a1a

Please sign in to comment.