Fix NPE on startup (#520)
This commit is contained in:
@@ -31,6 +31,9 @@ import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import me.lucko.luckperms.api.Tristate;
|
||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||
import me.lucko.luckperms.common.config.LuckPermsConfiguration;
|
||||
import me.lucko.luckperms.common.constants.Constants;
|
||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||
|
||||
import net.kyori.text.Component;
|
||||
@@ -60,6 +63,16 @@ public abstract class SenderFactory<T> {
|
||||
|
||||
protected abstract boolean hasPermission(T t, String node);
|
||||
|
||||
protected String getConsoleName() {
|
||||
LuckPermsConfiguration config = getPlugin().getConfiguration();
|
||||
return config == null ? Constants.CONSOLE_NAME.apply(null) : Constants.CONSOLE_NAME.apply(config.get(ConfigKeys.SERVER));
|
||||
}
|
||||
|
||||
protected String getImportName() {
|
||||
LuckPermsConfiguration config = getPlugin().getConfiguration();
|
||||
return config == null ? Constants.IMPORT_NAME.apply(null) : Constants.IMPORT_NAME.apply(config.get(ConfigKeys.SERVER));
|
||||
}
|
||||
|
||||
public final Sender wrap(@NonNull T sender) {
|
||||
return new AbstractSender<>(plugin, this, sender);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user