]> git.openstreetmap.org Git - nominatim.git/commitdiff
Fix wrong variable used with PEAR::IsError()
authorDaniele Forsi <daniele@forsi.it>
Mon, 9 Jul 2012 16:16:54 +0000 (18:16 +0200)
committerDaniele Forsi <daniele@forsi.it>
Mon, 9 Jul 2012 16:16:54 +0000 (18:16 +0200)
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

website/reverse.php

index 4cd950168c61f8599ea550d77e03a310167e4d73..70779dd714efbe647cbf5d549481e5c16cf78828 100755 (executable)
                        $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