Skip to content

Commit

Permalink
Merge pull request #95 from dkarlovi/patch-1
Browse files Browse the repository at this point in the history
fix: correctly handle not found data
  • Loading branch information
dpfaffenbauer authored Oct 6, 2023
2 parents 677f4c4 + b23d46c commit c0b9047
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ProcessManagerBundle/Model/Executable/Dao.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getById($id = null)

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

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

Expand Down
2 changes: 1 addition & 1 deletion src/ProcessManagerBundle/Model/Process/Dao.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getById($id = null)

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

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

Expand Down

0 comments on commit c0b9047

Please sign in to comment.