mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Conditions - Added null-checks to accessors
Conditions - Simplified operators, removing unnecessary expression trees
This commit is contained in:
1 parent
ad3581a93a
commit
33373bda57
24 files changed
+253
-311
No files matched your search
+7
-2
@@ -128,10 +128,15 @@ namespace Artemis.UI.Screens.ProfileEditor.Conditions
|
||||
if (DataModelConditionPredicate.Operator == null)
|
||||
DataModelConditionPredicate.UpdateOperator(Operators.FirstOrDefault(o => o.SupportsType(leftSideType)));
|
||||
SelectedOperator = DataModelConditionPredicate.Operator;
|
||||
if (!SelectedOperator.SupportsRightSide)
|
||||
{
|
||||
DisposeRightSideStatic();
|
||||
DisposeRightSideDynamic();
|
||||
}
|
||||
|
||||
// Ensure the right side has the proper VM
|
||||
var targetType = LeftSideSelectionViewModel?.SelectedPropertyViewModel?.PropertyInfo?.PropertyType;
|
||||
if (DataModelConditionPredicate.PredicateType == ProfileRightSideType.Dynamic)
|
||||
if (DataModelConditionPredicate.PredicateType == ProfileRightSideType.Dynamic && SelectedOperator.SupportsRightSide)
|
||||
{
|
||||
DisposeRightSideStatic();
|
||||
if (RightSideSelectionViewModel == null)
|
||||
@@ -147,7 +152,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Conditions
|
||||
);
|
||||
RightSideSelectionViewModel.FilterTypes = new[] {targetType};
|
||||
}
|
||||
else
|
||||
else if (SelectedOperator.SupportsRightSide)
|
||||
{
|
||||
DisposeRightSideDynamic();
|
||||
if (RightSideInputViewModel == null)
|
||||
|
||||
Reference in new issue
Block a user