Skip to content

Commit c0b9047

Browse files
Merge pull request #95 from dkarlovi/patch-1
fix: correctly handle not found data
2 parents 677f4c4 + b23d46c commit c0b9047

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/ProcessManagerBundle/Model/Executable/Dao.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getById($id = null)
3636

3737
$data = $this->db->fetchAssociative('SELECT * FROM '.$this->tableName.' WHERE id = ?', [$this->model->getId()]);
3838

39-
if (!$data["id"]) {
39+
if ($data === false) {
4040
throw new \Exception("Executable with the ID " . $this->model->getId() . " doesn't exists");
4141
}
4242

src/ProcessManagerBundle/Model/Process/Dao.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getById($id = null)
3636

3737
$data = $this->db->fetchAssociative('SELECT * FROM '.$this->tableName.' WHERE id = ?', [$this->model->getId()]);
3838

39-
if (!$data["id"]) {
39+
if ($data === false) {
4040
throw new \Exception("Process with the ID " . $this->model->getId() . " doesn't exists");
4141
}
4242

0 commit comments

Comments
 (0)