From f11744f3733a24df996ec39c11f9e4add4c285ae Mon Sep 17 00:00:00 2001
From: Justin Toupin <21499-justin2pin@users.noreply.drupalcode.org>
Date: Sat, 9 Dec 2023 16:07:31 +0000
Subject: [PATCH] Issue #3260656 by minorOffense: Update from 1.0.0 to 2.x
 (1013cfc) runs forever and watchdog shows error

---
 layout_paragraphs.install | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layout_paragraphs.install b/layout_paragraphs.install
index 8f309df..caaef7d 100644
--- a/layout_paragraphs.install
+++ b/layout_paragraphs.install
@@ -54,6 +54,6 @@ function layout_paragraphs_update_9001(&$sandbox) {
     $sandbox['progress']++;
     $sandbox['current_pk'] = $id;
   }
-  $sandbox['#finished'] = empty($sandbox['max']) ? 1 : $sandbox['progress'] / $sandbox['max'];
+  $sandbox['#finished'] = empty($sandbox['max']) || count($ids) == 0 ? 1 : $sandbox['progress'] / $sandbox['max'];
 
 }
-- 
GitLab