Skip to content

Commit

Permalink
Update AvatarRootSlot.cs
Browse files Browse the repository at this point in the history
Fixed a world crash bug... Oopsie daisy :)
  • Loading branch information
LeCloutPanda committed May 1, 2024
1 parent 7ed8521 commit f0c47b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ProjectObsidian/ProtoFlux/Avatar/AvatarRootSlot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ public class AvatarRootSlot : ObjectFunctionNode<ExecutionContext, Slot>
protected override Slot Compute(ExecutionContext context)
{
User user = User.Evaluate(context);
if (user == null) return null;

Slot slot = user.Root.Slot;
List<AvatarRoot> list = new List<AvatarRoot>();
slot.GetFirstDirectComponentsInChildren(list);
return user == null || list.Count == 0 ? null : list[0].Slot;
if (list.Count == 0) return null;

return list[0].Slot;
}
}
}

0 comments on commit f0c47b2

Please sign in to comment.