Skip to content

Commit 62691b2

Browse files
committed
Fix nullrefs when making operations
1 parent 8f109ec commit 62691b2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

YarnSpinner/QuestGraphs/QuestGraph.Operations.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static Expression MakeAnd(IEnumerable<Expression?> children)
5858

5959
var result = new Expression
6060
{
61-
And = { }
61+
And = new NAryExpression()
6262
};
6363
result.And.Children.AddRange(expressions);
6464
return result;
@@ -94,9 +94,9 @@ public static Expression MakeOr(IEnumerable<Expression?> children)
9494

9595
var result = new Expression
9696
{
97-
Or = { }
97+
Or = new NAryExpression()
9898
};
99-
result.And.Children.AddRange(expressions);
99+
result.Or.Children.AddRange(expressions);
100100
return result;
101101
}
102102

@@ -114,7 +114,7 @@ public static Expression MakeNot(Expression? child)
114114

115115
return new Expression
116116
{
117-
Not = { Expr = child },
117+
Not = new UnaryExpression { Expr = child },
118118
};
119119
}
120120

0 commit comments

Comments
 (0)