From 964e73f0f6e384717a5ed009d9d7c446d1134f6f Mon Sep 17 00:00:00 2001 From: ah Date: Tue, 26 Jul 2022 16:08:14 +0200 Subject: [PATCH] small nullpointer fix in EntityGadget, in case meta gadget is not set --- src/main/java/emu/grasscutter/game/entity/EntityGadget.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/game/entity/EntityGadget.java b/src/main/java/emu/grasscutter/game/entity/EntityGadget.java index f74a79e7b..7e68ad2bf 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntityGadget.java +++ b/src/main/java/emu/grasscutter/game/entity/EntityGadget.java @@ -219,9 +219,12 @@ public class EntityGadget extends EntityBaseGadget { .setConfigId(this.getConfigId()) .setGadgetState(this.getState()) .setIsEnableInteract(true) - .setDraftId(this.metaGadget.draft_id) .setAuthorityPeerId(this.getScene().getWorld().getHostPeerId()); + if(this.metaGadget != null) { + gadgetInfo.setDraftId(this.metaGadget.draft_id); + } + if (this.getContent() != null) { this.getContent().onBuildProto(gadgetInfo); }