Skip to content

Commit

Permalink
fix: MaskingShapeContainer NullReferenceException in demo (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Sep 14, 2024
1 parent 04fb510 commit 96a090f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Packages/src/Runtime/MaskingShape/MaskingShape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,14 @@ private void SetContainerDirty()
private void UpdateContainer()
{
Mask mask = null;
MaskingShapeContainer newContainer = null;
if (isActiveAndEnabled)
{
var useStencil = UISoftMaskProjectSettings.useStencilOutsideScreen;
Utils.GetStencilBits(transform, false, useStencil, out mask, out var _);
newContainer = mask.GetOrAddComponent<MaskingShapeContainer>();
}

var newContainer = mask.GetOrAddComponent<MaskingShapeContainer>();
if (newContainer != _container)
{
if (_container)
Expand Down

0 comments on commit 96a090f

Please sign in to comment.