diff --git a/Debugger/Debugger.Core/NRefactory/Visitors/ExpressionEvaluator.cs b/Debugger/Debugger.Core/NRefactory/Visitors/ExpressionEvaluator.cs index 938b9d6f2..ca7f72c79 100644 --- a/Debugger/Debugger.Core/NRefactory/Visitors/ExpressionEvaluator.cs +++ b/Debugger/Debugger.Core/NRefactory/Visitors/ExpressionEvaluator.cs @@ -572,8 +572,13 @@ namespace ICSharpCode.NRefactory.Visitors TypedValue GetThisValue() { - // This is needed so that captured 'this' is supported - return new TypedValue(context.GetThisValue(), (DebugType)context.MethodInfo.DeclaringType); + try { + // This is needed so that captured 'this' is supported + return new TypedValue(context.GetThisValue(), (DebugType)context.MethodInfo.DeclaringType); + } catch (GetValueException) { + // static method + return null; + } } public override object VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data)