Fixup Database behaviour

This commit is contained in:
Philipp 2021-08-07 22:07:47 +02:00
parent 90c99520bb
commit 470ba8b61b
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
4 changed files with 8 additions and 11 deletions

View file

@ -101,7 +101,7 @@ class Database implements ISelectableStorage
public function delete(string $reference)
{
try {
if (!$this->dba->delete('storage', ['id' => $reference])) {
if (!$this->dba->delete('storage', ['id' => $reference]) || $this->dba->affectedRows() === 0) {
throw new ReferenceStorageException(sprintf('Database storage failed to delete %s', $reference));
}
} catch (Exception $exception) {