Fix #7, Crash when selecting default world type

master
Treer 2018-06-17 01:04:07 +10:00
parent e4adcb5308
commit b17c6846f0
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ public class WorldTypes {
public boolean contains(String worldTypeName) {
for(WorldType worldType: selectable_AsList) {
if (worldType.getName() == worldTypeName) return true;
if (worldType.getName().equals(worldTypeName)) return true;
}
return false;
}

View File

@ -43,7 +43,7 @@ public enum WorldType {
private static WorldType findInstance(String nameOrValue) {
for (WorldType worldType : values()) {
if (worldType.name.equalsIgnoreCase(nameOrValue)
|| worldType.symbolicFieldName.equalsIgnoreCase(nameOrValue)) {
|| (worldType.symbolicFieldName != null && worldType.symbolicFieldName.equalsIgnoreCase(nameOrValue))) {
return worldType;
}
}