]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/template/address-jsonv2.php
don't have an address property in the return if we have not got address data
[nominatim.git] / lib / template / address-jsonv2.php
index d697730c14226dd68378517376443bd2bcc272b7..51d3e1a3027863c51815fccd8dd465855f6cd2fd 100644 (file)
@@ -29,7 +29,7 @@
 
                $aFilteredPlaces['display_name'] = $aPlace['langaddress'];
                 $aFilteredPlaces['name'] = $aPlace['placename'];
-               if ($bShowAddressDetails) $aFilteredPlaces['address'] = $aAddress;
+               if ($bShowAddressDetails && $aAddress && sizeof($aAddress)) $aFilteredPlaces['address'] = $aAddress;
        }
 
        if (isset($_GET['json_callback']) && preg_match('/^[-A-Za-z0-9:_]+$/',$_GET['json_callback']))