Browse Source

Fix #613: NullReferenceException when I add `new DirectoryInfo(".")` to watches in debug.

pull/617/head
Andreas Weizel 11 years ago
parent
commit
a502cf0eaf
  1. 2
      src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluationVisitor.cs
  2. 2
      src/AddIns/Debugger/Debugger.Core/Value.cs

2
src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluationVisitor.cs

@ -444,7 +444,7 @@ namespace Debugger.AddIn @@ -444,7 +444,7 @@ namespace Debugger.AddIn
} else
throw new GetValueException("Invoked member must be a method or property");
Value target = null;
if (!usedMethod.IsStatic)
if (!usedMethod.IsStatic && !usedMethod.IsConstructor)
target = Convert(result.TargetResult).GetPermanentReference(evalThread);
return InvokeMethod(target, usedMethod, result.Arguments.Select(rr => Convert(rr).GetPermanentReference(evalThread)).ToArray());
}

2
src/AddIns/Debugger/Debugger.Core/Value.cs

@ -416,6 +416,8 @@ namespace Debugger @@ -416,6 +416,8 @@ namespace Debugger
if (memberInfo == null)
throw new DebuggerException("memberInfo is null");
if (!memberInfo.IsStatic) {
if (memberInfo.SymbolKind == SymbolKind.Constructor)
throw new GetValueException("Constructor expression");
if (objectInstance == null)
throw new DebuggerException("No target object specified");
if (objectInstance.IsNull)

Loading…
Cancel
Save