Skip to content

Commit 123682c

Browse files
committed
fix: fixed where condition issue
1 parent ae92729 commit 123682c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/dialects/base/blocks.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ module.exports = function (dialect) {
148148
dialect.blocks.add('condition', (parameters) => {
149149
const { condition } = parameters;
150150

151-
if (isUndefined(condition)) {
151+
if (isUndefined(condition) || condition === null) {
152152
return '';
153153
}
154154

@@ -158,7 +158,8 @@ module.exports = function (dialect) {
158158
);
159159
}
160160

161-
return 'where ' + dialect.buildCondition(condition);
161+
const conditionString = dialect.buildCondition(condition);
162+
return conditionString ? 'where ' + conditionString : '';
162163
});
163164

164165
dialect.blocks.add('modifier', (parameters) => {

0 commit comments

Comments
 (0)