Skip to content

Commit 793def6

Browse files
Fix bug: check allParIndex against size of all, not visible, paragraphs
1 parent 432f593 commit 793def6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ public final Optional<Integer> allParToVisibleParIndex(int allParIndex) {
794794
if (allParIndex < 0) {
795795
throw new IllegalArgumentException("The given paragraph index (allParIndex) cannot be negative but was " + allParIndex);
796796
}
797-
if (allParIndex >= getVisibleParagraphs().size()) {
797+
if (allParIndex >= getParagraphs().size()) {
798798
throw new IllegalArgumentException(String.format(
799799
"Paragraphs' last index is [%s] but allParIndex was [%s]",
800800
getParagraphs().size() - 1, allParIndex)

0 commit comments

Comments
 (0)