Fix file not exist notice possibility in IndexDocumentBundle, a=chris

Chris Pollett [2022-09-09 20:Sep:th]
Fix file not exist notice possibility in IndexDocumentBundle, a=chris
Filename
src/library/IndexDocumentBundle.php
diff --git a/src/library/IndexDocumentBundle.php b/src/library/IndexDocumentBundle.php
index 3b652359c..5c441a721 100644
--- a/src/library/IndexDocumentBundle.php
+++ b/src/library/IndexDocumentBundle.php
@@ -1381,7 +1381,11 @@ class IndexDocumentBundle implements CrawlConstants
         if (empty($file_handles[$partition])) {
             $postings_filename = $this->getPartitionBaseFolder($partition) .
                 "/" . IndexDocumentBundle::POSTINGS_FILENAME;
-            $fh = fopen($postings_filename , "r");
+            if (file_exists($postings_filename)) {
+                $fh = fopen($postings_filename, "r");
+            } else {
+                return "";
+            }
             $file_handles[$partition] = $fh;
         } else {
             $fh = $file_handles[$partition];
ViewGit