Skip to content

Commit cc48833

Browse files
Fix AbstractScrollGui dividing by lineLength = 0
1 parent 479e5e7 commit cc48833

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

invui/src/main/java/xyz/xenondevs/invui/gui/AbstractScrollGui.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ private int correctLine(int line) {
149149

150150
@Override
151151
public int getLineCount() {
152-
if (elements == null)
152+
if (elements == null || lineLength == 0)
153153
return 0;
154154

155155
return (int) Math.ceil((double) elements.size() / (double) lineLength);
156156
}
157157

158158
@Override
159159
public int getMaxLine() {
160-
if (elements == null)
160+
if (elements == null || lineLength == 0)
161161
return 0;
162162

163163
int visibleLines = contentListSlots.length / lineLength;

0 commit comments

Comments
 (0)