DirectorActivityLog: fix empty activity log exception

fixes #2505: empty activity log causes exception
fixes #2506
This commit is contained in:
moreamazingnick 2022-03-28 14:52:46 +02:00 committed by GitHub
parent 1caf0f40db
commit 83cc12944d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -62,6 +62,9 @@ class ActivityLogTable extends ZfQueryBasedTable
{
$rows = parent::fetchQueryRows();
// Hint -> DESC, that's why they are inverted
if (empty($rows)) {
return $rows;
}
$last = $rows[0]->id;
$first = $rows[count($rows) - 1]->id;
$db = $this->db();