Skip to content

Instantly share code, notes, and snippets.

@a-fro
Created December 6, 2019 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-fro/d46decd1f8aafabe98571a2da8975733 to your computer and use it in GitHub Desktop.
Save a-fro/d46decd1f8aafabe98571a2da8975733 to your computer and use it in GitHub Desktop.
diff --git a/menu_svg_icons.module b/menu_svg_icons.module
index 7ff6e74..601d52f 100644
--- a/menu_svg_icons.module
+++ b/menu_svg_icons.module
@@ -232,6 +232,10 @@ function menu_svg_icons_preprocess_block(&$variables) {
* Implements hook_preprocess_HOOK().
*/
function menu_svg_icons_preprocess_menu(&$variables) {
+ // Make sure there is a menu_name key
+ if (!isset($variables['menu_name'])) {
+ return;
+ }
/** @var \Drupal\menu_svg_icons\Entity\IconSetMenu $icon_set_menu_conf */
if ($icon_set_menu_conf = IconSetMenu::load($variables['menu_name'])) {
/** @var \Drupal\menu_svg_icons\IconSetInterface $icon_set */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment