Skip to content

Commit

Permalink
Merge pull request #462 from JordanMartinez/convertAssertToException
Browse files Browse the repository at this point in the history
Turn assert statement into IllegalArgumentException
  • Loading branch information
JordanMartinez authored Mar 23, 2017
2 parents cbf5066 + f540313 commit 7bf8f4c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public Paragraph(PS paragraphStyle, SegmentOps<SEG, S> segmentOps, SEG text, SEG
}

Paragraph(PS paragraphStyle, SegmentOps<SEG, S> segmentOps, List<SEG> segments) {
assert !segments.isEmpty();
if (segments.isEmpty()) {
throw new IllegalArgumentException("Cannot construct a Paragraph with an empty list of segments");
}

this.segmentOps = segmentOps;
this.segments = segments;
Expand Down

0 comments on commit 7bf8f4c

Please sign in to comment.