From da1bad1ed2013d8fbb0e9f4d33420bfaa5829296 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Thu, 16 Jan 2025 12:15:30 -0300 Subject: [PATCH] fix: prevent error when is empty files Signed-off-by: Vitor Mattos --- lib/Migration/Version11000Date20250114182030.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Migration/Version11000Date20250114182030.php b/lib/Migration/Version11000Date20250114182030.php index 22674c99c..3cf9aa1b8 100644 --- a/lib/Migration/Version11000Date20250114182030.php +++ b/lib/Migration/Version11000Date20250114182030.php @@ -49,12 +49,14 @@ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array ) ->orderBy('lim.id'); $result = $qb1->executeQuery(); - $identifyMethods = []; + $row = $result->fetch(); + if (!$row) { + return; + } $folder = $this->appData->getFolder('/'); $file = $folder->newFile('backup-table-libresign_identify_method.csv'); $maxId = 0; $fp = $file->write(); - $row = $result->fetch(); $identifyMethods[] = $row; fputcsv($fp, array_keys($row)); fputcsv($fp, $row);