Avoid NPE with Locations in config files.
This commit is contained in:
1 parent
8793bd6cef
commit
a2328c7271
1 file changed
+4
@@ -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