PaperMC/CraftBukkit-Patches/0136-Check-for-blank-OfflinePlayer-Names.patch

21 lines
903 B
Diff

From a416b1a77ca43eae714a6b088167e31f9ba6d750 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Mon, 14 Apr 2014 17:21:24 +1000
Subject: [PATCH] Check for blank OfflinePlayer Names
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 4920956..50a783e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1304,6 +1304,7 @@ public final class CraftServer implements Server {
public OfflinePlayer getOfflinePlayer(String name) {
Validate.notNull(name, "Name cannot be null");
+ com.google.common.base.Preconditions.checkArgument( !org.apache.commons.lang.StringUtils.isBlank( name ), "Name cannot be blank" ); // Spigot
OfflinePlayer result = getPlayerExact(name);
if (result == null) {
--
1.8.3.2