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
- Unnecessary modifications clutter the Scene when using a RectTransform driven by a LayoutGroup in a Prefab
- Files in the target folder are deleted without a proper warning when building an iOS project
- Character animation freezes when toggling animator on/off in a coroutine
- Certain textures are incorrectly marked in the render pass list when observed through Render Graph Viewer
- "Assertion failed on expression" error occurs when multiple Animation Components are instantiated after changing the Culling Type
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.