Skip to content

Commit 178b4dd

Browse files
author
robin.kluth
committed
Catch an null given error
1 parent a7b6bf5 commit 178b4dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/LdapAuth.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,10 @@ public function searchUser(string $searchFor, $attributes = "", $searchFilter =
378378
]);
379379
if (!$result) {
380380
// Something is wrong with the search query
381-
Yii::warning('ldap_search_error: ' . ldap_error($this->_l));
381+
if (is_null($this->_l)) {
382+
Yii::warning('ldap_search_error: null', __FUNCTION__);
383+
}
384+
Yii::warning('ldap_search_error: ' . ldap_error($this->_l), __FUNCTION__);
382385
break;
383386
}
384387
ldap_parse_result($this->_l, $result, $errcode, $matcheddn, $errmsg, $referrals, $controls);

0 commit comments

Comments
 (0)