Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add validation in .offset() #2908

Merged
merged 14 commits into from Oct 15, 2019
7 changes: 6 additions & 1 deletion src/query/builder.js
Expand Up @@ -825,7 +825,12 @@ assign(Builder.prototype, {

// Only allow a single "offset" to be set for the current query.
offset(value) {
this._single.offset = value;
const val = parseInt(value, 10);
if (isNaN(val)) {
this.client.logger.warn('A valid integer must be provided to offset');
} else {
this._single.offset = val;
}
return this;
},

Expand Down