From 5d6ca06f49deb76c9e09b1e3dff44193ee55f706 Mon Sep 17 00:00:00 2001 From: Dunak <19434539+dunak-debug@users.noreply.github.com> Date: Sun, 24 Oct 2021 14:56:38 +0200 Subject: [PATCH] fix(parser): Check if query is string type not undefined - Should fix issues when exports is wrong called with `.` instead of `:` --- src/parser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parser.js b/src/parser.js index 26cdb54..0a4980d 100644 --- a/src/parser.js +++ b/src/parser.js @@ -26,7 +26,8 @@ const parseTypes = (field, next) => { }; const parseParameters = (query, parameters) => { - if (query === undefined) throw new FormatError(`Undefined query passed`); + if (typeof query !== 'string') + throw new Error(`Non-string query passed. Make sure you use "oxmysql:execute" instead of "oxmysql.execute" when calling exports.`); if (!parameters || typeof parameters === 'function') return [query, []];