mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-12-25 14:02:12 +03:00
Fail clean for place lookups for null/invalid place_ids
This commit is contained in:
parent
5f941407b3
commit
d6b70c9b73
@ -37,6 +37,8 @@
|
||||
|
||||
function lookup()
|
||||
{
|
||||
if (!$this->iPlaceID) return null;
|
||||
|
||||
$sLanguagePrefArraySQL = "ARRAY[".join(',',array_map("getDBQuoted", $this->aLangPrefOrder))."]";
|
||||
|
||||
$sSQL = "select placex.*,";
|
||||
@ -47,6 +49,8 @@
|
||||
$sSQL .= " from placex where place_id = ".(int)$this->iPlaceID;
|
||||
$aPlace = $this->oDB->getRow($sSQL);
|
||||
|
||||
if (!$aPlace['place_id']) return null;
|
||||
|
||||
if ($this->bAddressDetails)
|
||||
{
|
||||
$aAddress = getAddressDetails($this->oDB, $sLanguagePrefArraySQL, $this->iPlaceID, $aPlace['calculated_country_code']);
|
||||
|
Loading…
Reference in New Issue
Block a user