Skip to content

Commit

Permalink
Avoid annoying Array key does not exist error
Browse files Browse the repository at this point in the history
  • Loading branch information
XavRsl committed Sep 9, 2014
1 parent aaeb7a4 commit 785c1c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Xavrsl/Ldap/Directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ protected function output() {
if(count($this->results) == 1 && count($this->attributes) == 1) {
$attr = $this->attributes[0];
$result = array_shift($this->results);

if (!array_key_exists($attr, $result)) return false;

return $this->format($result[$attr]);
}
Expand Down

0 comments on commit 785c1c6

Please sign in to comment.