diff --git a/src/parser/query_builder.cpp b/src/parser/query_builder.cpp
index 5cd7ca49..6984af85 100644
--- a/src/parser/query_builder.cpp
+++ b/src/parser/query_builder.cpp
@@ -462,6 +462,7 @@ void do_add_null_comparison_to_query(Query &query, Predicate::Operator op,
precondition(expr.indexes.empty(), "KeyPath queries not supported for object comparisons.");
switch (op) {
case Predicate::Operator::NotEqual:
+ // for not equal we negate the query and then fallthrough
query.Not();
case Predicate::Operator::Equal:
query.and_query(query.get_table()->column(expr.prop->table_column).is_null());
@@ -471,7 +472,6 @@ void do_add_null_comparison_to_query(Query &query, Predicate::Operator op,
}
}
-
void do_add_null_comparison_to_query(Query &query, const Schema &schema, const ObjectSchema &object_schema, Predicate::Comparison cmp,
const PropertyExpression &expr, Arguments &args)
{