From 4c1ed5353fb51d3e081547bf27bf300c27ad1265 Mon Sep 17 00:00:00 2001 From: Eusebiu Marcu Date: Wed, 2 Mar 2011 17:49:18 +0200 Subject: [PATCH] Fix this for static methods. --- .../NRefactory/Visitors/ExpressionEvaluator.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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)