mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 19:55:17 +01:00
Added null protection against null world values
This commit is contained in:
parent
62d69b1022
commit
61481dee44
@ -21,7 +21,7 @@ public class LocationAdapter extends TypeAdapter<Location> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(JsonWriter out, Location location) throws IOException {
|
public void write(JsonWriter out, Location location) throws IOException {
|
||||||
if (location == null) {
|
if (location == null || location.getWorld() == null) {
|
||||||
out.nullValue();
|
out.nullValue();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ public class LocationAdapter extends TypeAdapter<Location> {
|
|||||||
out.value(location.getYaw());
|
out.value(location.getYaw());
|
||||||
out.value(location.getPitch());
|
out.value(location.getPitch());
|
||||||
out.endArray();
|
out.endArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Location read(JsonReader in) throws IOException {
|
public Location read(JsonReader in) throws IOException {
|
||||||
|
Loading…
Reference in New Issue
Block a user