From fad8d515e21ef6f974035268e3ec521fe9f576c2 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Mon, 22 Dec 2025 11:02:09 +0100 Subject: [PATCH] fix(LogController): prevent iterator from jumping over the last item - when requesting getLastItem(), logIteratorFactory->getLogIterator() creates a new LogIterator(), which in construct calls $this->rewind() -> $this->next(). So this should already return a last known line in the file, there is no need for $iterator->next() to be called again Signed-off-by: Maksim Sukharev --- lib/Controller/LogController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Controller/LogController.php b/lib/Controller/LogController.php index 80b053b15..dab970189 100644 --- a/lib/Controller/LogController.php +++ b/lib/Controller/LogController.php @@ -69,7 +69,6 @@ public function get($query = '', $count = 50, $offset = 0): JSONResponse { */ private function getLastItem() { $iterator = $this->logIteratorFactory->getLogIterator($this->settingsService->getShownLevels()); - $iterator->next(); return $iterator->current(); }