SoftMaskForUGUI icon indicating copy to clipboard operation
SoftMaskForUGUI copied to clipboard

NullReferenceException when adding SoftMask component

Open CDTR-MattConroy opened this issue 2 years ago • 0 comments

Describe the bug When adding a SoftMask component to an empty GameObject, NullReferenceExceptions are continuously thrown until a Graphic is also added.

To Reproduce Steps to reproduce the behavior:

  1. Create an empty GameObject
  2. Add a SoftMask component
  3. See error in console

Expected behavior No errors are thrown when adding a SoftMask component. Either a default Graphic should be added if required (during Reset or OnValidate), or ideally, handle missing Graphic components.

Environment (please complete the following information):

  • Version: 1.0.2
  • Platform: Editor(Windows)
  • Unity version: 2022.3.9f1

Additional context

NullReferenceException: Object reference not set to an instance of an object
Coffee.UISoftMask.SoftMask.UpdateMaskTextures () (at ./Library/PackageCache/[email protected]/Scripts/SoftMask.cs:476)
UnityEngine.Canvas.SendWillRenderCanvases () (at <836aea33117647b388cc5f48bed669c4>:0)

CDTR-MattConroy avatar Oct 06 '23 07:10 CDTR-MattConroy