diff --git a/drift/lib/src/runtime/query_builder/expressions/expression.dart b/drift/lib/src/runtime/query_builder/expressions/expression.dart index fb3680af..ff9a9e5f 100644 --- a/drift/lib/src/runtime/query_builder/expressions/expression.dart +++ b/drift/lib/src/runtime/query_builder/expressions/expression.dart @@ -142,12 +142,18 @@ abstract class Expression implements FunctionParameter { /// An expression that is true if `this` resolves to any of the values in /// [values]. Expression isIn(Iterable values) { + if (values.isEmpty) { + return Constant(false); + } return _InExpression(this, values.toList(), false); } /// An expression that is true if `this` does not resolve to any of the values /// in [values]. Expression isNotIn(Iterable values) { + if (values.isEmpty) { + return Constant(true); + } return _InExpression(this, values.toList(), true); }