Skip to content

Commit

Permalink
Avoid type warning when using array_combine on empty arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
majentsch committed Sep 30, 2014
1 parent f190385 commit 8eb7db9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/Icinga/User.php
Expand Up @@ -198,7 +198,9 @@ public function getPermissions()
public function setPermissions(array $permissions)
{
natcasesort($permissions);
$this->permissions = array_combine($permissions, $permissions);
if (! empty($permissions)) {
$this->permissions = array_combine($permissions, $permissions);
}
return $this;
}

Expand Down

0 comments on commit 8eb7db9

Please sign in to comment.