mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-21 02:42:01 +00:00
Prevent NPEs in KeywordReplacer
This commit is contained in:
parent
329f93a4f6
commit
2c6a81a916
|
@ -44,10 +44,10 @@ public class KeywordReplacer implements IText
|
||||||
address = user.getAddress().toString();
|
address = user.getAddress().toString();
|
||||||
balance = Double.toString(user.getMoney());
|
balance = Double.toString(user.getMoney());
|
||||||
mails = Integer.toString(user.getMails().size());
|
mails = Integer.toString(user.getMails().size());
|
||||||
world = user.getLocation().getWorld().getName();
|
world = user.getLocation() == null || user.getLocation().getWorld() == null ? "" : user.getLocation().getWorld().getName();
|
||||||
worldTime12 = DescParseTickFormat.format12(user.getWorld().getTime());
|
worldTime12 = DescParseTickFormat.format12(user.getWorld() == null ? 0 : user.getWorld().getTime());
|
||||||
worldTime24 = DescParseTickFormat.format24(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().getFullTime()));
|
worldDate = DateFormat.getDateInstance(DateFormat.MEDIUM, ess.getI18n().getCurrentLocale()).format(DescParseTickFormat.ticksToDate(user.getWorld() == null ? 0 : user.getWorld().getFullTime()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue