Fix handling of empty strings passed to Block/ItemType
This commit is contained in:
@@ -236,6 +236,10 @@ public enum BlockType {
|
|||||||
*/
|
*/
|
||||||
public static BlockType lookup(String name, boolean fuzzy) {
|
public static BlockType lookup(String name, boolean fuzzy) {
|
||||||
String testName = name.replace(" ", "").toLowerCase();
|
String testName = name.replace(" ", "").toLowerCase();
|
||||||
|
|
||||||
|
if (testName.length() == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
BlockType type = lookup.get(testName);
|
BlockType type = lookup.get(testName);
|
||||||
|
|
||||||
|
|||||||
@@ -414,6 +414,10 @@ public enum ItemType {
|
|||||||
*/
|
*/
|
||||||
public static ItemType lookup(String name, boolean fuzzy) {
|
public static ItemType lookup(String name, boolean fuzzy) {
|
||||||
String testName = name.replace(" ", "").toLowerCase();
|
String testName = name.replace(" ", "").toLowerCase();
|
||||||
|
|
||||||
|
if (testName.length() == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
ItemType type = lookup.get(testName);
|
ItemType type = lookup.get(testName);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user