1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-22 22:34:43 +02:00

snowleo Prevent NPEs in KeywordReplacer

2c6a81a916
This commit is contained in:
ementalo
2012-06-25 23:38:20 +01:00
parent 6488882e1a
commit 49465358f9

View File

@@ -47,10 +47,10 @@ public class KeywordReplacer implements IText
address = user.getAddress().toString();
balance = Double.toString(user.getMoney());
mails = Integer.toString(user.getData().getMails() == null ? 0 : user.getData().getMails().size());
world = user.getLocation().getWorld().getName();
worldTime12 = DescParseTickFormat.format12(user.getWorld().getTime());
worldTime24 = DescParseTickFormat.format24(user.getWorld().getTime());
worldDate = DateFormat.getDateInstance(DateFormat.MEDIUM, ess.getI18n().getCurrentLocale()).format(DescParseTickFormat.ticksToDate(user.getWorld().getFullTime()));
world = user.getLocation() == null || user.getLocation().getWorld() == null ? "" : user.getLocation().getWorld().getName();
worldTime12 = DescParseTickFormat.format12(user.getWorld() == null ? 0 : user.getWorld().getTime());
worldTime24 = DescParseTickFormat.format24(user.getWorld() == null ? 0 : user.getWorld().getTime());
worldDate = DateFormat.getDateInstance(DateFormat.MEDIUM, ess.getI18n().getCurrentLocale()).format(DescParseTickFormat.ticksToDate(user.getWorld() == null ? 0 : user.getWorld().getFullTime()));
}
else
{