small nullpointer fix in EntityGadget, in case meta gadget is not set

This commit is contained in:
ah 2022-07-26 16:08:14 +02:00
parent bb8ae4c443
commit 964e73f0f6
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}