diff --git a/src/SaveHandler/DbTableGateway.php b/src/SaveHandler/DbTableGateway.php index 8cb2b3f5..994a4146 100644 --- a/src/SaveHandler/DbTableGateway.php +++ b/src/SaveHandler/DbTableGateway.php @@ -149,14 +149,14 @@ public function write($id, $data) */ public function destroy($id) { - $exists = (bool) $this->read($id); + if (! (bool) $this->read($id)) { + return true; + } - $deleted = (bool) $this->tableGateway->delete([ + return (bool) $this->tableGateway->delete([ $this->options->getIdColumn() => $id, $this->options->getNameColumn() => $this->sessionName, ]); - - return $exists ? $deleted : true; } /**