From 39800fc5d2d4eb5d8f99024d89c5342a7e0621e5 Mon Sep 17 00:00:00 2001
From: mikeytown2 <mikeytown2@282446.no-reply.drupal.org>
Date: Tue, 22 Dec 2015 10:46:58 -0800
Subject: [PATCH] Issue #1334894 by mikeytown2: Warning: Invalid argument
 supplied for foreach() in views_content_views_content_type_render()

---
 views_content/plugins/content_types/views.inc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/views_content/plugins/content_types/views.inc b/views_content/plugins/content_types/views.inc
index d9277d4b..d13157b2 100644
--- a/views_content/plugins/content_types/views.inc
+++ b/views_content/plugins/content_types/views.inc
@@ -120,9 +120,11 @@ function views_content_views_content_type_render($subtype, $conf, $panel_args, $
     $args = str_replace("%$id", $arg, $args);
   }
 
-  foreach ($panel_args as $id => $arg) {
-    if (is_string($arg)) {
-      $args = str_replace("@$id", $arg, $args);
+  if (!empty($panel_args) && is_array($panel_args)) {
+    foreach ($panel_args as $id => $arg) {
+      if (is_string($arg)) {
+        $args = str_replace("@$id", $arg, $args);
+      }
     }
   }
 
-- 
GitLab