Skip to content

Commit 7bf8f4c

Browse files
Merge pull request #462 from JordanMartinez/convertAssertToException
Turn assert statement into IllegalArgumentException
2 parents cbf5066 + f540313 commit 7bf8f4c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

richtextfx/src/main/java/org/fxmisc/richtext/model/Paragraph.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ public Paragraph(PS paragraphStyle, SegmentOps<SEG, S> segmentOps, SEG text, SEG
3939
}
4040

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

4446
this.segmentOps = segmentOps;
4547
this.segments = segments;

0 commit comments

Comments
 (0)