mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Data model debugger - Fixed dictionaries causing the debugger to fail
Data model debugger - Added realtime updating (can be disabled)
This commit is contained in:
1 parent
3c29c3aeeb
commit
41b8038b74
4 files changed
+75
-30
No files matched your search
@@ -213,9 +213,25 @@ namespace Artemis.Core
|
||||
Expression? expression = Expression.Convert(parameter, Target.GetType());
|
||||
Expression? nullCondition = null;
|
||||
|
||||
MethodInfo equals = typeof(object).GetMethod("Equals", BindingFlags.Static | BindingFlags.Public)!;
|
||||
foreach (DataModelPathSegment segment in _segments)
|
||||
{
|
||||
BinaryExpression notNull = Expression.NotEqual(expression, Expression.Default(expression.Type));
|
||||
BinaryExpression notNull;
|
||||
try
|
||||
{
|
||||
notNull = Expression.NotEqual(expression, Expression.Default(expression.Type));
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
notNull = Expression.NotEqual(
|
||||
Expression.Call(
|
||||
null,
|
||||
equals,
|
||||
Expression.Convert(expression, typeof(object)),
|
||||
Expression.Convert(Expression.Default(expression.Type), typeof(object))),
|
||||
Expression.Constant(true));
|
||||
}
|
||||
|
||||
nullCondition = nullCondition != null ? Expression.AndAlso(nullCondition, notNull) : notNull;
|
||||
expression = segment.Initialize(parameter, expression, nullCondition);
|
||||
if (expression == null)
|
||||
|
||||
Reference in new issue
Block a user