diff --git a/lib/private/Files/Type/Loader.php b/lib/private/Files/Type/Loader.php index 1ae783e8f83..710562d32b5 100644 --- a/lib/private/Files/Type/Loader.php +++ b/lib/private/Files/Type/Loader.php @@ -119,6 +119,10 @@ class Loader implements IMimeTypeLoader { ]); $qb->execute(); } catch (UniqueConstraintViolationException $e) { + if ($this->dbConnection->inTransaction()) { + // if we're inside a transaction we can't recover safely + throw $e; + } // something inserted it before us }