mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-12-22 16:57:40 +01:00
Fix NPE
This commit is contained in:
parent
152b9db80f
commit
2334f6c5c9
@ -47,7 +47,8 @@ public abstract class LegacyBlockItemRewriter<T extends BackwardsProtocol> exten
|
|||||||
JsonPrimitive jsonData = object.getAsJsonPrimitive("data");
|
JsonPrimitive jsonData = object.getAsJsonPrimitive("data");
|
||||||
short data = jsonData != null ? jsonData.getAsShort() : 0;
|
short data = jsonData != null ? jsonData.getAsShort() : 0;
|
||||||
String name = object.getAsJsonPrimitive("name").getAsString();
|
String name = object.getAsJsonPrimitive("name").getAsString();
|
||||||
boolean block = object.getAsJsonPrimitive("block").getAsBoolean();
|
JsonPrimitive blockField = object.getAsJsonPrimitive("block");
|
||||||
|
boolean block = blockField != null && blockField.getAsBoolean();
|
||||||
|
|
||||||
if (dataEntry.getKey().contains("-")) {
|
if (dataEntry.getKey().contains("-")) {
|
||||||
// Range of ids
|
// Range of ids
|
||||||
|
Loading…
Reference in New Issue
Block a user