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

@ -214,8 +214,15 @@ public class ChallengesManager
{
if (!this.isValidLevel(level))
{
user.sendMessage("challenges.admin.import.error",
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;
}