From b40eb4bdd5f70e427ec453608743e44a546898c0 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Thu, 19 Jun 2014 08:51:11 -0500
Subject: [PATCH] Don't crash if a custom list has no property form

---
 include/class.dynamic_forms.php | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php
index da13ad45e..c0a203646 100644
--- a/include/class.dynamic_forms.php
+++ b/include/class.dynamic_forms.php
@@ -1086,10 +1086,12 @@ class DynamicListItem extends VerySimpleModel {
     function getFilterData() {
         $raw = $this->getConfiguration();
         $props = array();
-        foreach ($this->getConfigurationForm()->getFields() as $field) {
-            $tag = $field->get('id');
-            if (isset($raw[$tag]))
-                $props[".$tag"] = $field->toString($raw[$tag]);
+        if ($form = $this->getConfigurationForm()) {
+            foreach ($form->getFields() as $field) {
+                $tag = $field->get('id');
+                if (isset($raw[$tag]))
+                    $props[".$tag"] = $field->toString($raw[$tag]);
+            }
         }
         return $props;
     }
-- 
GitLab