Better error check of files read from CrawlQueueBundle

Chris Pollett [2023-09-04 20:Sep:th]
Better error check of files read from CrawlQueueBundle
Filename
src/executables/QueueServer.php
diff --git a/src/executables/QueueServer.php b/src/executables/QueueServer.php
index 28d315efa..869c97ce3 100644
--- a/src/executables/QueueServer.php
+++ b/src/executables/QueueServer.php
@@ -2303,9 +2303,14 @@ class QueueServer implements CrawlConstants
                     $current_file = array_key_first($url_files);
                     $current_file_name = $url_files[$current_file];
                     if (!empty($current_file_name)) {
-                        $url_tuples = array_values(
+                        $url_file_contents =
                             $this->crawl_queue->getUrlsFileContents(
-                                $current_file_name));
+                            $current_file_name);
+                        $url_tuples = [];
+                        if (!empty($url_file_contents)
+                            && is_array($url_file_contents)) {
+                            $url_tuples = array_values($url_file_contents);
+                        }
                         unlink($current_file_name);
                     }
                     $tuple_index = 0;
ViewGit