Fixup Database behaviour

This commit is contained in:
Philipp
2021-08-07 22:07:47 +02:00
parent 90c99520bb
commit 470ba8b61b
4 changed files with 8 additions and 11 deletions
+1 -1
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) {