From 54aea7d75db2a65d4a78a0c6e8c0f3c340f720ed Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 3 Sep 2021 10:36:58 +0200 Subject: [PATCH] fix(migration): better warning message --- src/Appwrite/Migration/Migration.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index 85ddf14ac0..d9ef595411 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -97,15 +97,14 @@ abstract class Migration foreach ($all as $document) { go(function () use ($document, $callback) { + if (empty($document->getId()) || empty($document->getCollection())) { + Console::warning('Skipped Document due to missing ID or Collection.'); + return; + } $old = $document->getArrayCopy(); $new = call_user_func($callback, $document); - if (empty($new->getId())) { - Console::warning('Skipped Document due to missing ID.'); - return; - } - if (!$this->check_diff_multi($new->getArrayCopy(), $old)) { return; }