Fix null-pointer issue in ChallengeLevel creation.

This commit is contained in:
BONNe 2019-02-05 09:13:39 +02:00
parent fa03ea0669
commit 94a54c2156
2 changed files with 3 additions and 2 deletions

View File

@ -930,12 +930,13 @@ public class ChallengesManager
* @param uniqueID - new ID for challenge level.
* @return ChallengeLevel that is currently created.
*/
public ChallengeLevel createLevel(String uniqueID)
public ChallengeLevel createLevel(String uniqueID, World world)
{
if (!this.containsLevel(uniqueID))
{
ChallengeLevel level = new ChallengeLevel();
level.setUniqueId(uniqueID);
level.setWorld(world.getName());
this.saveLevel(level);
this.loadLevel(level);

View File

@ -244,7 +244,7 @@ public class AdminGUI extends CommonGUI
new EditLevelGUI(this.addon,
this.world,
this.user,
this.addon.getChallengesManager().createLevel(newName),
this.addon.getChallengesManager().createLevel(newName, this.world),
this.topLabel,
this.permissionPrefix,
this).build();