diff --git a/include/class_templateHandling.inc b/include/class_templateHandling.inc
index 2d8eb2c22b8cf6ef27e3ee47be688533163095a2..18b382a45ff713d971303fca56e03730f51016d9 100644
--- a/include/class_templateHandling.inc
+++ b/include/class_templateHandling.inc
@@ -138,6 +138,10 @@ class templateHandling
       $result = $attrs[$mask];
       if (is_array($result)) {
         unset($result['count']);
+        if (empty($result)) {
+          /* No value and empty value is the same in LDAP so we have to treat them the same */
+          $result = [''];
+        }
       } else {
         $result = [$result];
       }