Index: location.module
===================================================================
--- location.module	(revision 66681)
+++ location.module	(working copy)
@@ -915,32 +915,29 @@
           // whether this location was previously assigned a lat/lon manually or whether it was determined via geocoding.
           // If the lat/lon was determined from geocoding, then we will want to update the lat/lon using postal codes.
           // If the lat/lon was user-submitted, then we don't want to allow the current editor to change the lat/lon
-          if ($node->nid) {
-            $result = db_query("SELECT * FROM {location} WHERE type = 'node' AND eid = %d", $node->nid);
-            if ($location = db_fetch_object($result)) {
-              if ($location->source != LOCATION_LATLON_USER_SUBMITTED) {
-                if ($data = location_latlon_exact($node->locations[$index])) {
-                  $node->locations[$index]['lat'] = $data['lat'];
-                  $node->locations[$index]['lon'] = $data['lon'];
-                  $node->locations[$index]['latitude'] = $data['lat'];
-                  $node->locations[$index]['longitude'] = $data['lon'];
-                  $node->locations[$index]['source'] = LOCATION_LATLON_GEOCODED_EXACT;
-                }            
-                elseif ($data = location_get_postalcode_data($node->location)) {
-                  $node->locations[$index]['lat'] = $data['lat'];
-                  $node->locations[$index]['lon'] = $data['lon'];
-                  $node->locations[$index]['latitude'] = $data['lat'];
-                  $node->locations[$index]['longitude'] = $data['lon'];
-                  $node->locations[$index]['source'] = LOCATION_LATLON_GEOCODED_APPROX;
-                }
-                else {
-                  unset($node->locations[$index]['lat']);
-                  unset($node->locations[$index]['lon']);
-                  unset($node->locations[$index]['latitude']);
-                  unset($node->locations[$index]['longitude']);
-                  $node->locations[$index]['source'] = LOCATION_LATLON_UNDEFINED;
-                }
+          if ($node->vid && $location = db_fetch_object(db_query("SELECT * FROM {location} WHERE type = 'node' AND eid = %d", $node->vid))) {
+            if ($location->source != LOCATION_LATLON_USER_SUBMITTED) {
+              if ($data = location_latlon_exact($node->locations[$index])) {
+                $node->locations[$index]['lat'] = $data['lat'];
+                $node->locations[$index]['lon'] = $data['lon'];
+                $node->locations[$index]['latitude'] = $data['lat'];
+                $node->locations[$index]['longitude'] = $data['lon'];
+                $node->locations[$index]['source'] = LOCATION_LATLON_GEOCODED_EXACT;
+              }            
+              elseif ($data = location_get_postalcode_data($node->location)) {
+                $node->locations[$index]['lat'] = $data['lat'];
+                $node->locations[$index]['lon'] = $data['lon'];
+                $node->locations[$index]['latitude'] = $data['lat'];
+                $node->locations[$index]['longitude'] = $data['lon'];
+                $node->locations[$index]['source'] = LOCATION_LATLON_GEOCODED_APPROX;
               }
+              else {
+                unset($node->locations[$index]['lat']);
+                unset($node->locations[$index]['lon']);
+                unset($node->locations[$index]['latitude']);
+                unset($node->locations[$index]['longitude']);
+                $node->locations[$index]['source'] = LOCATION_LATLON_UNDEFINED;
+              }
             }
           }
           elseif ($data = location_latlon_exact($node->locations[$index])) {
