Search Issue Tracker
C# 6 null conditional access operator (?.) throws MissingComponentException instead of recognizing as null
1. Open attached Unity project "CSharpBug.zip"
2. Open "TestScene" scene
3. Inspect both "ThrowsException" and "Safe" GameObjects and scripts attached to them
4. Go into play mode
Expected result: Both scripts should yield the same results (print the success message)
Actual result: In Throws Exception script, there is a ?. operator which works as a check whether the object is null or not. Instead of ignoring the whole line of script, as meshfilter in this case is null, MissingComponentException is thrown.
Reproduced on: 2017.1.0p3, 2017.2.0b7, 2017.3.0a4
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [Android] ASTC HDR check may cause issues with RenderDoc
- [CPULM] Enabling indirect denoising and gaussian AO filter causes bright halos
- [Android]APK fails to be registered when building using Keystore with the build
- Fix doc and typo in Scene TemplatePipeline
- Analytics spams error console when it cannot connect