Skip to content

Commit ce4d48e

Browse files
committed
Fix NREs in GetParameters etc.
(cherry picked from commit 8b2b5f9)
1 parent 24fc423 commit ce4d48e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Mono.Debugging.Win32/CorObjectAdaptor.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,8 +1484,10 @@ protected override IEnumerable<ValueReference> OnGetParameters (EvaluationContex
14841484
if (met.IsStatic)
14851485
pos--;
14861486

1487-
yield return CorDebugUtil.CallHandlingComExceptions (() => CreateParameterReference (ctx, pos, pi.Name),
1487+
var parameter = CorDebugUtil.CallHandlingComExceptions (() => CreateParameterReference (ctx, pos, pi.Name),
14881488
string.Format ("Get parameter {0} of {1}", pi.Name, met.Name));
1489+
if (parameter != null)
1490+
yield return parameter;
14891491
}
14901492
yield break;
14911493
}
@@ -1494,8 +1496,10 @@ protected override IEnumerable<ValueReference> OnGetParameters (EvaluationContex
14941496
int count = CorDebugUtil.CallHandlingComExceptions (() => ctx.Frame.GetArgumentCount (), "GetArgumentCount()", 0);
14951497
for (int n = 0; n < count; n++) {
14961498
int locn = n;
1497-
yield return CorDebugUtil.CallHandlingComExceptions (() => CreateParameterReference (ctx, locn, "arg_" + (locn + 1)),
1499+
var parameter = CorDebugUtil.CallHandlingComExceptions (() => CreateParameterReference (ctx, locn, "arg_" + (locn + 1)),
14981500
string.Format ("Get parameter {0}", n));
1501+
if (parameter != null)
1502+
yield return parameter;
14991503
}
15001504
}
15011505

@@ -1608,8 +1612,10 @@ IEnumerable<ValueReference> GetLocals (CorEvaluationContext ctx, ISymbolScope sc
16081612
int count = ctx.Frame.GetLocalVariablesCount ();
16091613
for (int n = 0; n < count; n++) {
16101614
int locn = n;
1611-
yield return CorDebugUtil.CallHandlingComExceptions (() => CreateLocalVariableReference (ctx, locn, "local_" + (locn + 1)),
1615+
var localVar = CorDebugUtil.CallHandlingComExceptions (() => CreateLocalVariableReference (ctx, locn, "local_" + (locn + 1)),
16121616
string.Format ("Get local variable {0}", locn));
1617+
if (localVar != null)
1618+
yield return localVar;
16131619
}
16141620
yield break;
16151621
}

0 commit comments

Comments
 (0)