From 5802178bbd2dd30cda5dcc3f02f8cb7464256bf1 Mon Sep 17 00:00:00 2001 From: mezz Date: Mon, 2 Mar 2015 22:53:22 -0800 Subject: [PATCH] Fix #538 Internal error when changing Catalogue page with no trades --- src/main/java/forestry/mail/gui/ContainerCatalogue.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/forestry/mail/gui/ContainerCatalogue.java b/src/main/java/forestry/mail/gui/ContainerCatalogue.java index 0bd066de5..e6e4418e8 100755 --- a/src/main/java/forestry/mail/gui/ContainerCatalogue.java +++ b/src/main/java/forestry/mail/gui/ContainerCatalogue.java @@ -110,6 +110,9 @@ public class ContainerCatalogue extends Container implements IGuiSelectable { return; } + if (stations.size() == 0) { + return; + } stationIndex = (stationIndex + 1) % stations.size(); updateTradeInfo(); } @@ -120,6 +123,9 @@ public class ContainerCatalogue extends Container implements IGuiSelectable { return; } + if (stations.size() == 0) { + return; + } stationIndex = (stationIndex - 1 + stations.size()) % stations.size(); updateTradeInfo(); }