Skip to content

Commit

Permalink
Merge pull request #51 from Johann-S/fix-1
Browse files Browse the repository at this point in the history
Add a check if the object exists or not
  • Loading branch information
gabrielrcouto committed Apr 11, 2016
2 parents 6f47fc1 + c4b67dd commit 66d856b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ public function getNextObjectId()
*/
public function getObject($id)
{
// @todo: Check if the object exists
return $this->objects[$id];
return (isset($this->objects[$id]) && $this->objects[$id] !== null) ? $this->objects[$id] : null;
}

/**
Expand Down

0 comments on commit 66d856b

Please sign in to comment.