Fix ResizeUI nullref if component is destroyed by ManlyMarco · Pull Request #766 · bbepis/XUnity.AutoTranslator

Pull Request Overview

This PR fixes a null reference exception in the ResizeUI method that occurs when Unity components are destroyed during execution. The fix adds null checks to prevent accessing destroyed components or their GameObjects.

  • Adds null checks for Unity Component objects before accessing their properties
  • Prevents null reference exceptions when components are destroyed during UI resizing operations
  • Uses Unity's implicit bool conversion to detect destroyed objects

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.