Steps to reproduce:
- Create a new Unity project using the Universal 2D template
- Open the Sprite Library Editor window (Window > 2D > Sprite Library Editor window)
- Dock the Sprite Library Editor window
- Click the "Create new Sprite Library Asset"
- Click the "+" button 5 times to create 5 Categories
- Click the "+" button 5 times to create 5 Labels
- Right click on the Sprite Library Editor window and select "Close Tab"
- Click the "Discard" button
- Observe the Editor
Actual results: “Save Changes Failed - Index was out of range” error popup appears
Expected results: No error popup appears about saving changes since the "Discard" button was pressed
Reproducible with versions: 6000.0.67f1, 6000.3.9f1, 6000.4.0b9, 6000.5.0a7
Tested on (OS): MacOS SIlicon Tahoe 26.2, Ubuntu 24.04