fix(parser): Check if query is string type not undefined

- Should fix issues when exports is wrong called with `.` instead of `:`
This commit is contained in:
Dunak authored and GitHub committed 2021-10-24 14:56:38 +02:00
1 parent 4913d6e50a
commit 5d6ca06f49
1 file changed
+2 -1
+2 -1
View File
@@ -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, []];