Fix wrong variable used with PEAR::IsError()

Fixes:
PHP Fatal error:  Cannot use object of type DB_Error as array in /home/daniele/Programmazione/OSM/Nominatim/website/reverse.php on line 104
This commit is contained in:
Daniele Forsi 2012-07-09 18:16:54 +02:00
parent 980632053f
commit 9549bda474

View File

@ -101,12 +101,12 @@
$sSQL .= ' ORDER BY ST_distance('.$sPointSQL.', geometry) ASC limit 1';
//var_dump($sSQL);
$aPlace = $oDB->getRow($sSQL);
$iPlaceID = $aPlace['place_id'];
$iParentPlaceID = $aPlace['parent_place_id'];
if (PEAR::IsError($iPlaceID))
if (PEAR::IsError($aPlace))
{
failInternalError("Could not determine closest place.", $sSQL, $iPlaceID);
}
$iPlaceID = $aPlace['place_id'];
$iParentPlaceID = $aPlace['parent_place_id'];
}
// The point we found might be too small - use the address to find what it is a child of