From 5649117b1fea4885cbb295efe12c269e3366634a Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Mon, 29 Apr 2013 10:35:49 +0200 Subject: [PATCH] Fix an NPE --- .../mcore/ps/PSFormatAbstract.java | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/com/massivecraft/mcore/ps/PSFormatAbstract.java b/src/com/massivecraft/mcore/ps/PSFormatAbstract.java index 2ed855a8..66e477a1 100644 --- a/src/com/massivecraft/mcore/ps/PSFormatAbstract.java +++ b/src/com/massivecraft/mcore/ps/PSFormatAbstract.java @@ -88,22 +88,18 @@ public class PSFormatAbstract implements PSFormat Object val = null; - if (this.useWorldDisplayname) + val = ps.getWorld(); + if (val != null) { - val = ps.getWorld(); - val = Mixin.getWorldDisplayName(val.toString()); - if (val != null) ret.add(String.format(this.formatWorld, val)); - } - else if (this.useWorldAlias) - { - val = ps.getWorld(); - val = Mixin.getWorldAliasOrId(val.toString()); - if (val != null) ret.add(String.format(this.formatWorld, val)); - } - else - { - val = ps.getWorld(); - if (val != null) ret.add(String.format(this.formatWorld, val)); + if (this.useWorldDisplayname) + { + val = Mixin.getWorldDisplayName(val.toString()); + } + else if (this.useWorldAlias) + { + val = Mixin.getWorldAliasOrId(val.toString()); + } + ret.add(String.format(this.formatWorld, val)); } val = ps.getBlockX();