X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/21b0bac4e79db6913522ac98888c13823d359d32..d396505786ce3be105249c740e0d3365beb4ef10:/sql/functions.sql

diff --git a/sql/functions.sql b/sql/functions.sql
index d242418c..25769785 100644
--- a/sql/functions.sql
+++ b/sql/functions.sql
@@ -769,6 +769,13 @@ BEGIN
           -- null record of right type
           select * from placex where osm_type = 'N' and osm_id = waynodes[nodeidpos]::INTEGER and type = 'house' limit 1 INTO nextnode;
           select ST_SetSRID(ST_Point(lon::float/10000000,lat::float/10000000),4326) from planet_osm_nodes where id = waynodes[nodeidpos] INTO nextnode.geometry;
+          IF nextnode.geometry IS NULL THEN
+            -- we don't have any information about this point, most likely
+            -- because an excerpt was updated and the node never imported
+            -- because the interpolation is outside the region of the excerpt.
+            -- Give up.
+            RETURN newpoints;
+          END IF;
         ELSE
           select * from placex where place_id = search_place_id INTO nextnode;
         END IF;
