Skip to content

A free open source IT asset/license management system

Attempt to fix transient LDAP bug

snipeded61614d1cc
diff --git a/app/Services/LdapAd.php b/app/Services/LdapAd.php
index 925927d1fe..4bfef3d3ed 100644
--- a/app/Services/LdapAd.php
+++ b/app/Services/LdapAd.php
@@ -135,7 +135,7 @@ class LdapAd extends LdapAdConfiguration
$bind_as_user = true;
}
- if ($this->ldap->auth()->attempt($login_username, $password, $bind_as_user) === false) {
+ if (($this->ldap) && ($this->ldap->auth()->attempt($login_username, $password, $bind_as_user) === false)) {
throw new Exception('Unable to validate user credentials!');
}