Skip to content

Commit

Permalink
Fixed incorrectly throwing ObjectDoesNotExist
Browse files Browse the repository at this point in the history
A missing not operator (`!`) in the if-statements resulted in an `ObjectDoesNotExist` exception being thrown when the object actually existed.
  • Loading branch information
StianTorjussen authored Feb 22, 2021
1 parent 838ef03 commit 44e864f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Aplia/Content/ContentObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ protected function _remove($purge = true)
}
} elseif ($this->id) {
$contentObject = eZContentObject::fetch($this->id);
if ($contentObject) {
if (!$contentObject) {
throw new ObjectDoesNotExist("No Content Object with ID: '$this->id', cannot remove");
}
} else {
Expand All @@ -1238,7 +1238,7 @@ public function loadContentObject()
}
} elseif ($this->id) {
$this->contentObject = eZContentObject::fetch($this->id);
if ($this->contentObject) {
if (!$this->contentObject) {
throw new ObjectDoesNotExist("Content Object with ID: '$this->id' does not exist");
}
}
Expand Down

0 comments on commit 44e864f

Please sign in to comment.