From 5e82cc6daa76e95a8711f74e661b8c4dc24d6f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Thu, 21 Sep 2006 19:12:45 +0000 Subject: [PATCH] Fixed SD2-1114: Debugger throws exception when a null event argument is used. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1838 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Debugger.Core/Project/Src/Threads/Thread.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs index cca25b71d4..82ab0d5eb6 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs @@ -138,8 +138,16 @@ namespace Debugger if (!corThread.Is()) return false; // Is the debuggee .NET 2.0? if (LastFunction == null) return false; // Is frame available? It is not at StackOverflow - corThread.CastTo().InterceptCurrentException(LastFunction.CorILFrame.CastTo()); - return true; + try { + corThread.CastTo().InterceptCurrentException(LastFunction.CorILFrame.CastTo()); + return true; + } catch (COMException e) { + // 0x80131C02: Cannot intercept this exception + if ((uint)e.ErrorCode == 0x80131C02) { + return false; + } + throw; + } } internal Stepper GetStepper(ICorDebugStepper corStepper)