mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-19 04:52:30 +02:00
Prevent NPEs in KeywordReplacer
This commit is contained in:
@@ -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
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user