Skip to content

Commit

Permalink
Only process the property landarea field if it exists in the feed
Browse files Browse the repository at this point in the history
  • Loading branch information
davgothic committed Mar 4, 2016
1 parent dc08776 commit 267a319
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/YDD/Vebra/API.php
Expand Up @@ -366,11 +366,13 @@ public function getProperty($clientId, $propertyId)
$property->setGroundRent(self::normalise($xml->groundrent, 'string'));
$property->setCommission(self::normalise($xml->commission, 'string'));

$landArea = new LandArea(
self::normalise($xml->landarea->area, 'float')
);
$landArea->setAttributes($xml->landarea->attributes());
$property->setLandArea($landArea);
if ($xml->landarea) {
$landArea = new LandArea(
self::normalise($xml->landarea->area, 'float')
);
$landArea->setAttributes($xml->landarea->attributes());
$property->setLandArea($landArea);
}

$property->setStreetView(
new StreetView(
Expand Down

0 comments on commit 267a319

Please sign in to comment.