From 37ed42b37d32609ac245bc016978b8f4b2eb2367 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 28 Jul 2020 15:01:59 +0200 Subject: [PATCH] Fix model queries values not matching placeholder count --- src/db/ModelQuery.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/db/ModelQuery.ts b/src/db/ModelQuery.ts index 734c577..13c7452 100644 --- a/src/db/ModelQuery.ts +++ b/src/db/ModelQuery.ts @@ -272,7 +272,9 @@ class FieldValue { } public get variables(): any[] { - return this.value instanceof ModelQuery ? this.value.variables : [this.value]; + if (this.value instanceof ModelQuery) return this.value.variables; + if (this.raw || this.value === null) return []; + return [this.value]; } }