Skip to content

Commit

Permalink
Fix issue when users could open challenges gui, even if challenges in…
Browse files Browse the repository at this point in the history
… that world does not exist (#69)
  • Loading branch information
BONNe committed Feb 5, 2019
1 parent ecc7c97 commit fa03ea0
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ public ChallengesGUI(ChallengesAddon addon,
@Override
public void build()
{
// Do not open gui if there is no challenges.
if (this.challengesManager.getAllChallenges(this.world).isEmpty())
{
this.addon.getLogger().severe("There are no challenges set up!");
this.user.sendMessage("general.errors.general");
return;
}

PanelBuilder panelBuilder = new PanelBuilder().user(this.user).
name(this.user.getTranslation("challenges.gui.title"));

Expand Down

0 comments on commit fa03ea0

Please sign in to comment.