Index: location.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/location/location.module,v
retrieving revision 1.222.2.25
diff -u -r1.222.2.25 location.module
--- location.module	30 Jul 2009 20:58:43 -0000	1.222.2.25
+++ location.module	3 Dec 2009 17:41:50 -0000
@@ -1450,21 +1450,25 @@
   $location = $variables['location'];
   // This will get taken back out if map links are hidden.
   $location['map_link'] = TRUE;
-  foreach($variables['hide'] as $key) {
-    unset($location[$key]);
-    // Special case for coords.
-    if ($key == 'coords') {
-      unset($location['latitude']);
-      unset($location['longitude']);
+  if (is_array($variables['hide'])) {
+    foreach($variables['hide'] as $key) {
+      unset($location[$key]);
+      // Special case for coords.
+      if ($key == 'coords') {
+        unset($location['latitude']);
+        unset($location['longitude']);
+      }
     }
   }
 
   $fields = location_field_names(TRUE);
-  foreach ($fields as $key => $value) {
-    $variables[$key] = '';
-    // Arrays can't be converted, ignore them.
-    if (!empty($location[$key]) && !is_array($location[$key])) {
-      $variables[$key] = check_plain($location[$key]);
+  if (is_array($fields)) {
+    foreach ($fields as $key => $value) {
+      $variables[$key] = '';
+      // Arrays can't be converted, ignore them.
+      if (!empty($location[$key]) && !is_array($location[$key])) {
+        $variables[$key] = check_plain($location[$key]);
+      }
     }
   }
 
