From: Marc Tobias Metten Date: Wed, 18 Feb 2015 16:53:49 +0000 (+0100) Subject: check database results before using variable X-Git-Tag: v2.4.0~34 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/3c2c3ab67411f500ca2b0658b088127a9ba4169a?ds=sidebyside check database results before using variable --- diff --git a/lib/PlaceLookup.php b/lib/PlaceLookup.php index f013fe17..6da82fd8 100644 --- a/lib/PlaceLookup.php +++ b/lib/PlaceLookup.php @@ -51,6 +51,10 @@ $sSQL .= " from placex where place_id = ".(int)$this->iPlaceID; $aPlace = $this->oDB->getRow($sSQL); + if (PEAR::IsError($aPlace)) + { + failInternalError("Could not lookup place.", $sSQL, $aPlace); + } if (!$aPlace['place_id']) return null; if ($this->bAddressDetails)