diff options
author | GJ <gjmcferrin@gmail.com> | 2014-01-31 09:42:03 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2014-04-18 10:21:33 -0500 |
commit | 730adbbf42adf0ce2fdcd54df73f7fb7cabd5ccd (patch) | |
tree | da00e9e7ea3a41f99d1634516e9fd1a936e8f53d /src/main/java | |
parent | 2a2cdd48857a2985a4e0988a63dfd598d0f60860 (diff) | |
download | craftbukkit-730adbbf42adf0ce2fdcd54df73f7fb7cabd5ccd.tar craftbukkit-730adbbf42adf0ce2fdcd54df73f7fb7cabd5ccd.tar.gz craftbukkit-730adbbf42adf0ce2fdcd54df73f7fb7cabd5ccd.tar.lz craftbukkit-730adbbf42adf0ce2fdcd54df73f7fb7cabd5ccd.tar.xz craftbukkit-730adbbf42adf0ce2fdcd54df73f7fb7cabd5ccd.zip |
[Bleeding] Don't allow null display names. Fixes BUKKIT-5254
Currently, plugins can set a player's display name to null, which could
cause issues for other calls to getDisplayName that aren't expecting a null
value. This changes setDisplayName to follow the same logic as
setPlayerListName, which sets the player's name back to their unmodified
"vanilla" name if it receives a null value as a parameter.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 7c427fa3..55ea121b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -169,7 +169,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setDisplayName(final String name) { - getHandle().displayName = name; + getHandle().displayName = name == null ? getName() : name; } @Override |