--- gmap_location.module	2007-08-04 09:16:45.000000000 -0700
+++ gmap_location.module.new	2007-08-10 16:57:18.000000000 -0700
@@ -601,21 +601,24 @@ function gmap_location_user($op, &$edit,
       case 'update':
         // source==1, location.module's LOCATION_LATLON_USER_SUBMITTED define.
         // Insert or update based on the existance of $user->gmap_location_set.
-        if ($user->gmap_location_set) {
-          db_query("UPDATE {location} SET latitude = %s , longitude = %s , source = 1 WHERE eid = %d AND type = 'user'",
-            gmap_decimal($edit['gmap_location_latitude']),
-            gmap_decimal($edit['gmap_location_longitude']),
-            $user->uid);
-        }
-        else {
-          $lid = db_next_id('{location}_lid');
-          db_query("INSERT INTO {location} (eid, lid, type, latitude, longitude, source) VALUES (%d, %d, 'user', %s, %s, 1)",
-            $user->uid, $lid,
-            gmap_decimal($edit['gmap_location_latitude']),
-            gmap_decimal($edit['gmap_location_longitude']));
+        $have_pos = isset($edit['gmap_location_latitude']) && isset($edit['gmap_location_longitude']);
+        if ($have_pos) {
+          if ($user->gmap_location_set) {
+            db_query("UPDATE {location} SET latitude = %s , longitude = %s , source = 1 WHERE eid = %d AND type = 'user'",
+              gmap_decimal($edit['gmap_location_latitude']),
+              gmap_decimal($edit['gmap_location_longitude']),
+              $user->uid);
+          }
+          else {
+            $lid = db_next_id('{location}_lid');
+            db_query("INSERT INTO {location} (eid, lid, type, latitude, longitude, source) VALUES (%d, %d, 'user', %s, %s, 1)",
+              $user->uid, $lid,
+              gmap_decimal($edit['gmap_location_latitude']),
+              gmap_decimal($edit['gmap_location_longitude']));
+          }
+          unset($edit['gmap_location_latitude']);
+          unset($edit['gmap_location_longitude']);
         }
-        unset($edit['gmap_location_latitude']);
-        unset($edit['gmap_location_longitude']);
         return;
 
       case 'form':
