Reproduction steps:
1. Open the attached project “2DShadow_Bugs.zip”
2. Open Assets/Scenes/PSB_EmptyLayerNullRef.unity
Expected result: no NullReferenceExceptions thrown
Actual result: two NullReferenceExceptions thrown
Reproducible with: 2023.2.0a10, 2023.2.0a17
Not reproducible with: 2022.3.0f1, 2023.1.0b19, 2023.2.0a9
Could not test with: 2021.3.25f1 (errors)
Reproducible on: macOS 13.2.1 (Intel), Windows 11 (user’s)
Note: if the issue is not reproducible, try entering Play mode