summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-08-25 14:51:57 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-08-26 18:58:06 +0200
commit18908af87b6048521c90364aaca01e83e24c22ef (patch)
tree1bd5d9cf56542a98ae6fccd8a0885050332a8922 /lib
parent2bf15eda2610b2a06dabe3f3b6ae0675a9980ec4 (diff)
downloadnextcloud-server-18908af87b6048521c90364aaca01e83e24c22ef.tar.gz
nextcloud-server-18908af87b6048521c90364aaca01e83e24c22ef.zip
Dont swallow exception when inserting mimetypes if we're inside a transaction
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Type/Loader.php4
1 files changed, 4 insertions, 0 deletions
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
}