Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2019.4
2019.4.16f1
2020.2
2021.1
2021.2
Issue ID
1305910
Regression
No
Exception object is null when there are multiple catch blocks with the same variable name while using Unity Debugger
Reproduction steps:
1. Open user's project "UnityDebuggerRepro.zip"
2. Open "SampleScene" Scene
3. Open a project (any project, can be empty) in Visual Studio and attach Unity Debugger of the opened project
4. Make sure "Common Language Runtime Exceptions" are all checked in "Exception Settings"
5. Enter Play Mode in Unity Editor
6. In Visual Studio, "Step Over" using F10 or button in the toolbar until you reach inside of "catch(SocketException ex)" block
7. Look at the "Autos" window to observe variables
Expected result: "ex" variable has a value of SocketException
Actual result: "ex" variable is null
Reproducible with: 2018.4.32f1, 2019.4.21f1, 2020.2.7f1, 2021.1.0b10, 2021.2.0a7
Note: Reproducible using both Mono and IL2CPP Scripting Backends
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (2021.1.X):
This appears to be a problem specific to the unity plugin for Visual Studio as the Rider debugger does not exhibit the same behavior. The bug has been passed along to them for further investigation.