Avoid NPE with Locations in config files.
This commit is contained in:
@@ -98,6 +98,10 @@ public class ConfigUtils
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setLocation(ConfigurationSection config, String path, Location location) {
|
public static void setLocation(ConfigurationSection config, String path, Location location) {
|
||||||
|
if (location == null) {
|
||||||
|
config.set(path, null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
String x = twoPlaces(location.getX());
|
String x = twoPlaces(location.getX());
|
||||||
String y = twoPlaces(location.getY());
|
String y = twoPlaces(location.getY());
|
||||||
String z = twoPlaces(location.getZ());
|
String z = twoPlaces(location.getZ());
|
||||||
|
|||||||
Reference in New Issue
Block a user