diff --git a/sites/all/modules/contrib/finder/includes/finder.inc b/sites/all/modules/contrib/finder/includes/finder.inc
index b8d6415..22a6a00 100644
--- a/sites/all/modules/contrib/finder/includes/finder.inc
+++ b/sites/all/modules/contrib/finder/includes/finder.inc
@@ -497,48 +497,48 @@ class finder {
     else {
       $elements = &$this->elements;
     }
-
-    foreach ($elements as $finder_element) {
-      $this->choice_delete($finder_element);
-
-      $choices_style = $this->esetting($finder_element, 'choices_style');
-
-      $list = array();
-      if ($choices_style == 'available_options' || $choices_style == 'available_options_php') {
-        if ($choices_style == 'available_options_php') {
-          finder_inc('build');
-          $available_options = finder_eval($this->esetting($finder_element, 'available_options_php'), array('finder_element' => $finder_element));
-        }
-        else {
-          $available_options = $this->esetting($finder_element, 'available_options');
-        }
-
-        $available_options = explode("\n", $available_options);
-
-        foreach ($available_options as $available_option) {
-          if (strpos($available_option, '|') !== FALSE) {
-            list($key, $value) = explode('|', $available_option);
-            $list[$key] = (isset($value) && $value !== '') ? $value : $key;
+    if(is_array($elements)){
+      foreach ($elements as $finder_element) {
+        $this->choice_delete($finder_element);
+  
+        $choices_style = $this->esetting($finder_element, 'choices_style');
+  
+        $list = array();
+        if ($choices_style == 'available_options' || $choices_style == 'available_options_php') {
+          if ($choices_style == 'available_options_php') {
+            finder_inc('build');
+            $available_options = finder_eval($this->esetting($finder_element, 'available_options_php'), array('finder_element' => $finder_element));
           }
           else {
-            $list[$available_option] = $available_option;
+            $available_options = $this->esetting($finder_element, 'available_options');
           }
+  
+          $available_options = explode("\n", $available_options);
+  
+          foreach ($available_options as $available_option) {
+            if (strpos($available_option, '|') !== FALSE) {
+              list($key, $value) = explode('|', $available_option);
+              $list[$key] = (isset($value) && $value !== '') ? $value : $key;
+            }
+            else {
+              $list[$available_option] = $available_option;
+            }
+          }
+  
+        }
+  
+        foreach ($list as $choice_key => $choice_value) {
+          // insert list items into table.
+          db_insert('finder_choice')->fields(array(
+            'finder' => $this->id,
+            'element' => $finder_element->id,
+            'choice_key' => $choice_key,
+            'choice_value' => $choice_value,
+          ))
+          ->execute();
         }
-
-      }
-
-      foreach ($list as $choice_key => $choice_value) {
-        // insert list items into table.
-        db_insert('finder_choice')->fields(array(
-          'finder' => $this->id,
-          'element' => $finder_element->id,
-          'choice_key' => $choice_key,
-          'choice_value' => $choice_value,
-        ))
-        ->execute();
       }
     }
-
   }
 
   /**
