From 1208f41bc52f4ad536737bd5043972cbda41f831 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Wed, 18 Oct 2023 10:50:29 -0400 Subject: [PATCH] avoid error when save() has no changes --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 095a0bc..09636d7 100644 --- a/index.js +++ b/index.js @@ -130,7 +130,7 @@ exports.initMigrationFramework = function initMigrationFramework(conn) { modelName: this.constructor.modelName, opName: 'save', parameters: { - where: this.isNew ? null : this.$__delta()[0], + where: this.isNew ? null : (this.$__delta() || [])[0], isNew: this.isNew, changes: this.getChanges() }