Fix empty map.

This commit is contained in:
Hoang Huu 2019-12-04 14:03:31 +07:00
parent 2285106cad
commit 685803792e
2 changed files with 8 additions and 0 deletions

View File

@ -741,6 +741,10 @@ function opalestate_get_property_walkscore_results( $property ) {
$map = $property->get_map();
if ( ! $map || ! is_array( $map ) || ! isset( $map['latitude'] ) || ! isset( $map['longitude'] ) ) {
return false;
}
$latitude = $map['latitude'];
$longitude = $map['longitude'];

View File

@ -16,6 +16,10 @@ if ( ! $categories ) {
$map = $property->get_map();
if ( ! $map || ! is_array( $map ) || ! isset( $map['latitude'] ) || ! isset( $map['longitude'] ) ) {
return;
}
$latitude = $map['latitude'];
$longitude = $map['longitude'];
if ( ! $latitude || ! $longitude ) {