From 2fa6fef168e148a6ac8da8e6ed3bcbca7275d5ed Mon Sep 17 00:00:00 2001 From: NichtStudioCode <51272202+NichtStudioCode@users.noreply.github.com> Date: Thu, 16 Jun 2022 16:55:16 +0200 Subject: [PATCH] Changed argument check order in ScrollGUI --- .../src/main/java/de/studiocode/invui/gui/impl/ScrollGUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvUI/src/main/java/de/studiocode/invui/gui/impl/ScrollGUI.java b/InvUI/src/main/java/de/studiocode/invui/gui/impl/ScrollGUI.java index 8ebe416..b887458 100644 --- a/InvUI/src/main/java/de/studiocode/invui/gui/impl/ScrollGUI.java +++ b/InvUI/src/main/java/de/studiocode/invui/gui/impl/ScrollGUI.java @@ -29,10 +29,10 @@ public abstract class ScrollGUI extends BaseGUI { this.lineLength = SlotUtils.getLongestLineLength(itemListSlots, width); this.lineAmount = (int) Math.ceil((double) itemListSlots.length / (double) lineLength); - if (lineLength == 0) - throw new IllegalArgumentException("Line length can't be 0"); if (itemListSlots.length == 0) throw new IllegalArgumentException("No item list slots provided"); + if (lineLength == 0) + throw new IllegalArgumentException("Line length can't be 0"); if (itemListSlots.length % lineLength != 0) throw new IllegalArgumentException("itemListSlots has to be a multiple of lineLength"); }