From 8eb7db9b3575a829f97c892b72f4483e7582b890 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Tue, 30 Sep 2014 15:50:58 +0200 Subject: [PATCH] Avoid type warning when using array_combine on empty arrays --- library/Icinga/User.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icinga/User.php b/library/Icinga/User.php index 03aa1bcd2..659767644 100644 --- a/library/Icinga/User.php +++ b/library/Icinga/User.php @@ -198,7 +198,9 @@ class User public function setPermissions(array $permissions) { natcasesort($permissions); - $this->permissions = array_combine($permissions, $permissions); + if (! empty($permissions)) { + $this->permissions = array_combine($permissions, $permissions); + } return $this; }