Skip to content

Commit c5a35bb

Browse files
committed
Checks for expression in Cypher.minus getCypher
1 parent e3a3447 commit c5a35bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/expressions/operations/math.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ class UnaryMathOp extends MathOp {
5858
* @internal
5959
*/
6060
public getCypher(env: CypherEnvironment): string {
61-
const exprStr = this.exprs[0].getCypher(env);
61+
const expr = this.exprs[0];
62+
if (!expr) {
63+
throw new Error("Error in Cypher.minus, expr is not defined");
64+
}
65+
const exprStr = expr.getCypher(env);
6266

6367
return `${this.operator}${exprStr}`;
6468
}

0 commit comments

Comments
 (0)