fixed bug when no domains exist

This commit is contained in:
tracer 2024-04-17 13:14:09 +02:00
parent 8f946d9360
commit 2eb96742bb
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@
"name": "24unix/bindapi",
"description": "manage Bind9 DNS server via REST API",
"version": "2023.0.1",
"build_number": "334",
"build_number": "335",
"authors": [
{
"name": "Micha Espey",

View File

@ -245,7 +245,8 @@ readonly class DomainRepository
$statement = $this->databaseConnection->getConnection()->prepare(query: $sql);
$statement->execute();
$result = $statement->fetch();
return $result['length'];
// if there are not yet any domains, just return 30
return $result['length'] ?? 30;
} catch (PDOException $e) {
exit($e->getMessage());
}