diff --git a/bem.function.php b/bem.function.php index 00bd459..b86550e 100644 --- a/bem.function.php +++ b/bem.function.php @@ -43,6 +43,11 @@ if (class_exists('Drupal')) { $attributes = new Attribute(); + // Ensure that the context attributes are an array (this is not a given) + if (!$context['attributes']) { + $context['attributes'] = []; + } + // Iterate the attributes available in context. foreach($context['attributes'] as $key => $value) { // If there are classes, add them to the classes array.