Fix an annoying quest NPE

This commit is contained in:
Spencer 2017-12-29 00:36:36 -05:00 committed by Alexander Meech
parent b699ef475d
commit dd40ebbff5

View File

@ -1,5 +1,9 @@
package nautilus.game.arcade.quest; package nautilus.game.arcade.quest;
import java.util.Arrays;
import java.util.Objects;
import java.util.stream.Collectors;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
@ -63,7 +67,7 @@ public class QuestTracker<T extends Game> implements Listener
boolean cont = true; boolean cont = true;
for (String questItem : quest.getItem()) for (String questItem : quest.getItem())
{ {
for (String str : items) for (String str : Arrays.stream(items).filter(Objects::nonNull).collect(Collectors.toList()))
{ {
String first = str.replaceAll(" ", ""); String first = str.replaceAll(" ", "");
String compare = questItem.replaceAll(" ", ""); String compare = questItem.replaceAll(" ", "");