Fix CMD sign NPE; resolves #822

This commit is contained in:
Daniel Saukel 2020-06-17 00:14:09 +02:00
parent 3d6781b91b
commit c7240462c0
2 changed files with 3 additions and 6 deletions

View File

@ -18,7 +18,6 @@ package de.erethon.dungeonsxl.sign.windup;
import de.erethon.dungeonsxl.DungeonsXL;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
@ -31,7 +30,7 @@ public class CommandScript {
private String name;
private File file;
private List<String> commands = new ArrayList<>();
private List<String> commands;
public CommandScript(String name, List<String> commands, Permission permission) {
this.name = name;
@ -45,11 +44,8 @@ public class CommandScript {
name = file.getName().replace(".yml", "");
this.file = file;
if (config.getStringList("commands") != null) {
setCommands(config.getStringList("commands"));
}
}
public String getName() {
return name;

View File

@ -86,6 +86,7 @@ public class CommandSign extends Windup {
@Override
public void initialize() {
script = ((DungeonsXL) api).getCommandScriptRegistry().get(getLine(1));
String[] attributes = getLine(2).split(",");
if (attributes.length == 3) {