mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-09-07 04:38:03 +02:00
Prevent some NPE on (auto)purge
This commit is contained in:
parent
35a4e6508c
commit
7ba37d75c9
@ -43,6 +43,7 @@ public class DataManager extends Thread {
|
||||
public void purgeAntiXray(List<String> cleared) {
|
||||
int i = 0;
|
||||
for (String name : cleared) {
|
||||
try {
|
||||
org.bukkit.OfflinePlayer player = getOfflinePlayer(name);
|
||||
if (player == null)
|
||||
continue;
|
||||
@ -52,6 +53,7 @@ public class DataManager extends Thread {
|
||||
playerFile.delete();
|
||||
i++;
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " AntiXRayData Files");
|
||||
}
|
||||
@ -59,6 +61,7 @@ public class DataManager extends Thread {
|
||||
public void purgeLimitedCreative(List<String> cleared) {
|
||||
int i = 0;
|
||||
for (String name : cleared) {
|
||||
try {
|
||||
org.bukkit.OfflinePlayer player = getOfflinePlayer(name);
|
||||
if (player == null)
|
||||
continue;
|
||||
@ -78,6 +81,7 @@ public class DataManager extends Thread {
|
||||
playerFile.delete();
|
||||
i++;
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " LimitedCreative Survival, Creative and Adventure files");
|
||||
}
|
||||
@ -85,6 +89,7 @@ public class DataManager extends Thread {
|
||||
public void purgeDat(List<String> cleared) {
|
||||
int i = 0;
|
||||
for (String name : cleared) {
|
||||
try {
|
||||
org.bukkit.OfflinePlayer player = getOfflinePlayer(name);
|
||||
if (player == null)
|
||||
continue;
|
||||
@ -94,6 +99,7 @@ public class DataManager extends Thread {
|
||||
playerFile.delete();
|
||||
i++;
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " .dat Files");
|
||||
}
|
||||
@ -101,11 +107,13 @@ public class DataManager extends Thread {
|
||||
public void purgeEssentials(List<String> cleared) {
|
||||
int i = 0;
|
||||
for (String name : cleared) {
|
||||
try {
|
||||
File playerFile = new File(plugin.ess.getDataFolder() + File.separator + "userdata" + File.separator + name + ".yml");
|
||||
if (playerFile.exists()) {
|
||||
playerFile.delete();
|
||||
i++;
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
ConsoleLogger.info("AutoPurgeDatabase : Remove " + i + " EssentialsFiles");
|
||||
}
|
||||
|
@ -45,14 +45,12 @@ public class SendMailSSL {
|
||||
props.put("mail.smtp.port", String.valueOf(Settings.getMailPort));
|
||||
|
||||
Session session = Session.getInstance(props, new javax.mail.Authenticator() {
|
||||
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(Settings.getmailAccount, Settings.getmailPassword);
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
|
||||
final Message message = new MimeMessage(session);
|
||||
try {
|
||||
message.setFrom(new InternetAddress(Settings.getmailAccount, sendername));
|
||||
@ -68,7 +66,6 @@ public class SendMailSSL {
|
||||
text = text.replace("<generatedpass>", newPass);
|
||||
message.setContent(text, "text/html");
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
@ -84,5 +81,4 @@ public class SendMailSSL {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user