aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/user_ldap/lib/User/User.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index 3d247663b3f..51fd577104c 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -6,6 +6,7 @@
* @author Joas Schilling <coding@schilljs.com>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Thomas Müller <thomas.mueller@tmit.eu>
+ * @author Jörn Friedrich Dreyer <jfd@butonic.de>
*
* @license AGPL-3.0
*
@@ -111,6 +112,12 @@ class User {
IConfig $config, FilesystemHelper $fs, Image $image,
LogWrapper $log, IAvatarManager $avatarManager, IUserManager $userManager) {
+ if ($username === null) {
+ throw new \InvalidArgumentException("uid for '$dn' must not be null!");
+ } else if ($username === '') {
+ throw new \InvalidArgumentException("uid for '$dn' must not be an empty string!");
+ }
+
$this->access = $access;
$this->connection = $access->getConnection();
$this->config = $config;