--- a/gosa-core/include/functions.inc
+++ b/gosa-core/include/functions.inc
@@ -3576,6 +3576,11 @@
   }
   $styles= session::global_get('img-styles');
 
+  /* If there's nothing available, just return nothing */
+  if (!array_key_exists($path, $styles)) {
+    return "";
+  }
+
   /* Extract labels from path */
   if (preg_match("/\.png\[(.*)\]$/", $path, $matches)) {
     $label= $matches[1];
