Commit 9781d5e6 authored by Magix's avatar Magix Committed by GitHub
Browse files

Fix an NPE in `EntityGadget` when `draft_id` isn't set

Merge pull request #1579 from Hartie95/nullfix
parents 107111d3 964e73f0
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment