mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-23 10:45:23 +01:00
Fix NPE on startup with flatfile
This commit is contained in:
parent
6e17b540f5
commit
7596266d7c
@ -205,7 +205,7 @@ public class AuthMe extends JavaPlugin {
|
||||
databaseThread = fileThread;
|
||||
final int a = database.getAccountsRegistered();
|
||||
if (a >= 1000) {
|
||||
ConsoleLogger.showError("YOUR USING FILE DATABASE WITH " + a + "+ ACCOUNTS, FOR BETTER PERFORMANCES, PLEASE USE MYSQL!!");
|
||||
ConsoleLogger.showError("YOU'RE USING FILE DATABASE WITH " + a + "+ ACCOUNTS, FOR BETTER PERFORMANCES, PLEASE USE MYSQL!!");
|
||||
}
|
||||
break;
|
||||
case MYSQL:
|
||||
|
@ -31,8 +31,11 @@ public class FlatFileThread extends Thread implements DataSource {
|
||||
*/
|
||||
private File source;
|
||||
|
||||
public void run() {
|
||||
public FlatFileThread() {
|
||||
source = new File(Settings.AUTH_FILE);
|
||||
}
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
source.createNewFile();
|
||||
} catch (IOException e) {
|
||||
|
@ -23,7 +23,7 @@ import fr.xephi.authme.security.HashAlgorithm;
|
||||
|
||||
public final class Settings extends YamlConfiguration {
|
||||
|
||||
public static final String PLUGIN_FOLDER = "." + File.separator + "plugins" + File.separator + "AuthMe";
|
||||
public static String PLUGIN_FOLDER = "." + File.separator + "plugins" + File.separator + "AuthMe";
|
||||
public static final String CACHE_FOLDER = Settings.PLUGIN_FOLDER + File.separator + "cache";
|
||||
public static final String AUTH_FILE = Settings.PLUGIN_FOLDER + File.separator + "auths.db";
|
||||
public static final String MESSAGE_FILE = Settings.PLUGIN_FOLDER + File.separator + "messages";
|
||||
@ -106,6 +106,7 @@ public final class Settings extends YamlConfiguration {
|
||||
load();
|
||||
}
|
||||
configFile = (YamlConfiguration) plugin.getConfig();
|
||||
PLUGIN_FOLDER = plugin.getDataFolder().toString();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
Loading…
Reference in New Issue
Block a user