mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-27 00:49:44 +00:00
[trunk]fix nullpointer on mails after you clear them
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1323 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
96a1bdedc8
commit
bbf1bef888
2 changed files with 17 additions and 12 deletions
|
@ -62,9 +62,9 @@ public class Essentials extends JavaPlugin
|
||||||
File dataFolder = File.createTempFile("essentialstest", "");
|
File dataFolder = File.createTempFile("essentialstest", "");
|
||||||
dataFolder.delete();
|
dataFolder.delete();
|
||||||
dataFolder.mkdir();
|
dataFolder.mkdir();
|
||||||
logger.log(Level.INFO,"Using temp folder for testing:");
|
logger.log(Level.INFO, "Using temp folder for testing:");
|
||||||
logger.log(Level.INFO,dataFolder.toString());
|
logger.log(Level.INFO, dataFolder.toString());
|
||||||
this.initialize(null, null, new PluginDescriptionFile(new FileReader(new File("src"+File.separator+"plugin.yml"))), dataFolder, null, null);
|
this.initialize(null, null, new PluginDescriptionFile(new FileReader(new File("src" + File.separator + "plugin.yml"))), dataFolder, null, null);
|
||||||
settings = new Settings(dataFolder);
|
settings = new Settings(dataFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,8 @@ public class Essentials extends JavaPlugin
|
||||||
{
|
{
|
||||||
setStatic();
|
setStatic();
|
||||||
EssentialsUpgrade upgrade = new EssentialsUpgrade(this.getDescription().getVersion(), this);
|
EssentialsUpgrade upgrade = new EssentialsUpgrade(this.getDescription().getVersion(), this);
|
||||||
if (newWorldsLoaded) {
|
if (newWorldsLoaded)
|
||||||
|
{
|
||||||
logger.log(Level.SEVERE, "New worlds have been loaded while upgrading files. The server will stop now, please restart it.");
|
logger.log(Level.SEVERE, "New worlds have been loaded while upgrading files. The server will stop now, please restart it.");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -355,11 +356,14 @@ public class Essentials extends JavaPlugin
|
||||||
if (user != null && !getSettings().isCommandDisabled("mail") && !commandLabel.equals("mail") && user.isAuthorized("essentials.mail"))
|
if (user != null && !getSettings().isCommandDisabled("mail") && !commandLabel.equals("mail") && user.isAuthorized("essentials.mail"))
|
||||||
{
|
{
|
||||||
List<String> mail = user.getMails();
|
List<String> mail = user.getMails();
|
||||||
if (!mail.isEmpty())
|
if (mail != null)
|
||||||
|
{
|
||||||
|
if (mail.size() > 0)
|
||||||
{
|
{
|
||||||
user.sendMessage(ChatColor.RED + "You have " + mail.size() + " messages!§f Type §7/mail read§f to view your mail.");
|
user.sendMessage(ChatColor.RED + "You have " + mail.size() + " messages!§f Type §7/mail read§f to view your mail.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check for disabled commands
|
// Check for disabled commands
|
||||||
if (getSettings().isCommandDisabled(commandLabel))
|
if (getSettings().isCommandDisabled(commandLabel))
|
||||||
|
@ -607,11 +611,13 @@ public class Essentials extends JavaPlugin
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIConomyFallback(boolean iConomyFallback) {
|
public void setIConomyFallback(boolean iConomyFallback)
|
||||||
|
{
|
||||||
this.iConomyFallback = iConomyFallback;
|
this.iConomyFallback = iConomyFallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isIConomyFallbackEnabled() {
|
public boolean isIConomyFallbackEnabled()
|
||||||
|
{
|
||||||
return iConomyFallback;
|
return iConomyFallback;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.earth2me.essentials;
|
package com.earth2me.essentials;
|
||||||
|
|
||||||
import com.earth2me.essentials.commands.IEssentialsCommand;
|
import com.earth2me.essentials.commands.IEssentialsCommand;
|
||||||
import java.text.DecimalFormat;
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
Loading…
Reference in a new issue