fix 500 on reverse via search without result

e.g. /search?q=1,1
This commit is contained in:
Sarah Hoffmann
2013-05-06 21:04:09 +02:00
parent eaf09c54c5
commit ea48296eed

View File

@@ -1266,8 +1266,10 @@
if (isset($_GET['nearlat']) && trim($_GET['nearlat'])!=='' && isset($_GET['nearlon']) && trim($_GET['nearlon']) !== '') if (isset($_GET['nearlat']) && trim($_GET['nearlat'])!=='' && isset($_GET['nearlon']) && trim($_GET['nearlon']) !== '')
{ {
$iPlaceID = geocodeReverse($_GET['nearlat'], $_GET['nearlon']); $iPlaceID = geocodeReverse($_GET['nearlat'], $_GET['nearlon']);
$aResultPlaceIDs = array($iPlaceID);
if ($iPlaceID)
{
$aResultPlaceIDs = array($iPlaceID);
// TODO: this needs refactoring! // TODO: this needs refactoring!
// Get the details for display (is this a redundant extra step?) // Get the details for display (is this a redundant extra step?)
@@ -1334,6 +1336,11 @@
failInternalError("Could not get details for place (near).", $sSQL, $aSearchResults); failInternalError("Could not get details for place (near).", $sSQL, $aSearchResults);
} }
} }
else
{
$aSearchResults = array();
}
}
} }
} }