Fix issue in importing challenges from ASkyBlock when importing crashes with null-pointer.

Null-pointer happened because there were mistake in level unique_id getting. It was leftover from old unique_id scheme...
This commit is contained in:
BuildTools 2019-08-14 22:00:11 +03:00
parent 6f357b3197
commit 54f91180d6

View File

@ -160,8 +160,12 @@ public class ChallengesImportManager
newChallenge.setRewardItems(parseItems(details.getString("itemReward", ""))); newChallenge.setRewardItems(parseItems(details.getString("itemReward", "")));
newChallenge.setRepeatItemReward(parseItems(details.getString("repeatItemReward", ""))); newChallenge.setRepeatItemReward(parseItems(details.getString("repeatItemReward", "")));
// Save // Save
this.addon.getChallengesManager().addChallengeToLevel(newChallenge, if (!details.getString("level", "").isEmpty())
addon.getChallengesManager().getLevel(Util.getWorld(world).getName() + "_" + details.getString("level", ""))); {
this.addon.getChallengesManager().addChallengeToLevel(newChallenge,
addon.getChallengesManager().getLevel(
Utils.getGameMode(world) + "_" + details.getString("level", "")));
}
if (addon.getChallengesManager().loadChallenge(newChallenge, overwrite, user, false)) { if (addon.getChallengesManager().loadChallenge(newChallenge, overwrite, user, false)) {
size++; size++;