]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/ReversedFileReader.php
Catch exceptions for Worker::AddContact()
[friendica.git] / src / Util / ReversedFileReader.php
index bdc31f0cba158f3b5f86796cd54ed8fb537f8d41..0566002de29e899e75034972d51f2fa4ad023be1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2021, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -95,6 +95,9 @@ class ReversedFileReader implements \Iterator
                        if ($this->pos == 0) {
                                return array_pop($buffer);
                        }
+                       if (is_null($buffer)) {
+                               return null;
+                       }
                        if (count($buffer) > 1) {
                                return array_pop($buffer);
                        }