fixed bug when no domains exist
This commit is contained in:
parent
8f946d9360
commit
2eb96742bb
|
@ -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",
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue