Fix null-pointer crash when loading invalid challenge level.

This commit is contained in:
BONNe 2019-02-05 09:23:49 +02:00
parent 94a54c2156
commit 55578ab88c

View File

@ -213,9 +213,16 @@ public class ChallengesManager
public boolean loadLevel(ChallengeLevel level, boolean overwrite, User user, boolean silent)
{
if (!this.isValidLevel(level))
{
if (user != null)
{
user.sendMessage("challenges.admin.import.error",
"[object]", level.getFriendlyName());
}
else
{
this.addon.logError("Challenge Level '" + level.getUniqueId() + "' is not valid and skipped");
}
return false;
}