fixed bug when no domains exist
This commit is contained in:
parent
8f946d9360
commit
2eb96742bb
|
@ -2,7 +2,7 @@
|
||||||
"name": "24unix/bindapi",
|
"name": "24unix/bindapi",
|
||||||
"description": "manage Bind9 DNS server via REST API",
|
"description": "manage Bind9 DNS server via REST API",
|
||||||
"version": "2023.0.1",
|
"version": "2023.0.1",
|
||||||
"build_number": "334",
|
"build_number": "335",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Micha Espey",
|
"name": "Micha Espey",
|
||||||
|
|
|
@ -245,7 +245,8 @@ readonly class DomainRepository
|
||||||
$statement = $this->databaseConnection->getConnection()->prepare(query: $sql);
|
$statement = $this->databaseConnection->getConnection()->prepare(query: $sql);
|
||||||
$statement->execute();
|
$statement->execute();
|
||||||
$result = $statement->fetch();
|
$result = $statement->fetch();
|
||||||
return $result['length'];
|
// if there are not yet any domains, just return 30
|
||||||
|
return $result['length'] ?? 30;
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
exit($e->getMessage());
|
exit($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue