Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetDirtyAndNotify causes null exceptions on GameObject delete #192

Closed
PixelSolve opened this issue Sep 5, 2024 · 2 comments
Closed

SetDirtyAndNotify causes null exceptions on GameObject delete #192

PixelSolve opened this issue Sep 5, 2024 · 2 comments
Assignees
Labels
bug Something isn't working released

Comments

@PixelSolve
Copy link

Describe the bug
Sometimes when I delete on Initialization some GameObjects containing the SoftMask.cs component, I am getting null exceptions. Those are being casued by the call to MaskUtilities because those are not checking if the object still exists:

private void SetDirtyAndNotify() { SetSoftMaskDirty(); MaskUtilities.NotifyStencilStateChanged(this); }

I solved it by just adding if (isDirty || !this || !isActiveAndEnabled) return; before the MaskUtilities call, but there is probably some better way to solve it.

Thank you for developing this asset by the way, it's super helpful, it's honestly crazy that Unity doesnt support this by default.

@PixelSolve PixelSolve added the bug Something isn't working label Sep 5, 2024
@mob-sakai
Copy link
Owner

Thank you for your reporting!

github-actions bot pushed a commit that referenced this issue Sep 6, 2024
## [2.3.2](v2.3.1...v2.3.2) (2024-09-06)

### Bug Fixes

* SetDirtyAndNotify causes null exceptions on GameObject delete ([706f022](706f022)), closes [#192](#192)
@mob-sakai
Copy link
Owner

🎉 This issue has been resolved in version 2.3.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue Sep 6, 2024
## [2.3.2](v2.3.1...v2.3.2) (2024-09-06)

### Bug Fixes

* SetDirtyAndNotify causes null exceptions on GameObject delete ([706f022](706f022)), closes [#192](#192)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants