diff --git a/packages/orm/angel_orm/lib/src/query.dart b/packages/orm/angel_orm/lib/src/query.dart index 60437a94..39faf5fb 100644 --- a/packages/orm/angel_orm/lib/src/query.dart +++ b/packages/orm/angel_orm/lib/src/query.dart @@ -325,7 +325,7 @@ abstract class Query extends QueryBase { return super.getOne(executor); } - Future> delete(QueryExecutor executor) { + Future?> delete(QueryExecutor executor) { var sql = compile({}, preamble: 'DELETE', withFields: false); if (_joins.isEmpty) { @@ -346,7 +346,8 @@ abstract class Query extends QueryBase { } Future deleteOne(QueryExecutor executor) { - return delete(executor).then((it) => it.isEmpty ? null : it.first); + return delete(executor) + .then((it) => it?.isEmpty == true ? null : it?.first); } Future insert(QueryExecutor executor) { diff --git a/packages/orm/angel_orm/lib/src/query_executor.dart b/packages/orm/angel_orm/lib/src/query_executor.dart index cfb0997a..5848bbd0 100644 --- a/packages/orm/angel_orm/lib/src/query_executor.dart +++ b/packages/orm/angel_orm/lib/src/query_executor.dart @@ -19,5 +19,5 @@ abstract class QueryExecutor { /// /// Whether nested transactions are supported depends on the /// underlying driver. - Future transaction(FutureOr Function(QueryExecutor) f); + Future transaction(FutureOr Function(QueryExecutor) f); }