mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-22 15:22:47 +01: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
@ -56,15 +56,15 @@ public class Essentials extends JavaPlugin
|
||||
{
|
||||
return settings;
|
||||
}
|
||||
|
||||
|
||||
public void setupForTesting() throws IOException, InvalidDescriptionException
|
||||
{
|
||||
File dataFolder = File.createTempFile("essentialstest", "");
|
||||
dataFolder.delete();
|
||||
dataFolder.mkdir();
|
||||
logger.log(Level.INFO,"Using temp folder for testing:");
|
||||
logger.log(Level.INFO,dataFolder.toString());
|
||||
this.initialize(null, null, new PluginDescriptionFile(new FileReader(new File("src"+File.separator+"plugin.yml"))), dataFolder, null, null);
|
||||
logger.log(Level.INFO, "Using temp folder for testing:");
|
||||
logger.log(Level.INFO, dataFolder.toString());
|
||||
this.initialize(null, null, new PluginDescriptionFile(new FileReader(new File("src" + File.separator + "plugin.yml"))), dataFolder, null, null);
|
||||
settings = new Settings(dataFolder);
|
||||
}
|
||||
|
||||
@ -78,7 +78,8 @@ public class Essentials extends JavaPlugin
|
||||
{
|
||||
setStatic();
|
||||
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.");
|
||||
try
|
||||
{
|
||||
@ -355,9 +356,12 @@ public class Essentials extends JavaPlugin
|
||||
if (user != null && !getSettings().isCommandDisabled("mail") && !commandLabel.equals("mail") && user.isAuthorized("essentials.mail"))
|
||||
{
|
||||
List<String> mail = user.getMails();
|
||||
if (!mail.isEmpty())
|
||||
if (mail != null)
|
||||
{
|
||||
user.sendMessage(ChatColor.RED + "You have " + mail.size() + " messages!§f Type §7/mail read§f to view your mail.");
|
||||
if (mail.size() > 0)
|
||||
{
|
||||
user.sendMessage(ChatColor.RED + "You have " + mail.size() + " messages!§f Type §7/mail read§f to view your mail.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -606,12 +610,14 @@ public class Essentials extends JavaPlugin
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setIConomyFallback(boolean iConomyFallback) {
|
||||
|
||||
public void setIConomyFallback(boolean iConomyFallback)
|
||||
{
|
||||
this.iConomyFallback = iConomyFallback;
|
||||
}
|
||||
|
||||
public boolean isIConomyFallbackEnabled() {
|
||||
|
||||
public boolean isIConomyFallbackEnabled()
|
||||
{
|
||||
return iConomyFallback;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.commands.IEssentialsCommand;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.logging.Logger;
|
||||
|
Loading…
Reference in New Issue
Block a user