summaryrefslogtreecommitdiffstats
path: root/lib/private/User/Database.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/User/Database.php')
-rw-r--r--lib/private/User/Database.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php
index 73506c7d7c5..79032cfd405 100644
--- a/lib/private/User/Database.php
+++ b/lib/private/User/Database.php
@@ -92,7 +92,11 @@ class Database extends Backend implements IUserBackend {
$event = new GenericEvent($password);
$this->eventDispatcher->dispatch('OCP\PasswordPolicy::validate', $event);
$query = \OC_DB::prepare('INSERT INTO `*PREFIX*users` ( `uid`, `password` ) VALUES( ?, ? )');
- $result = $query->execute(array($uid, \OC::$server->getHasher()->hash($password)));
+ try {
+ $result = $query->execute(array($uid, \OC::$server->getHasher()->hash($password)));
+ } catch (\Exception $e) {
+ $result = false;
+ }
// Clear cache
unset($this->cache[$uid]);