diff --git a/src/View/Helper.php b/src/View/Helper.php
index <HASH>..<HASH> 100644
--- a/src/View/Helper.php
+++ b/src/View/Helper.php
@@ -197,9 +197,9 @@ class Helper implements EventListenerInterface
      */
     public function addClass(array $options = [], $class = null, $key = 'class')
     {
-        if (is_array($options[$key])) {
+        if (isset($options[$key]) && is_array($options[$key])) {
             $options[$key][] = $class;
-        } else if (isset($options[$key]) && trim($options[$key])) {
+        } elseif (isset($options[$key]) && trim($options[$key])) {
             $options[$key] .= ' ' . $class;
         } else {
             $options[$key] = $class;
Added isset.
Fix coding style