Skip to content

Commit 7e5ddb5

Browse files
committed
OS-115 Skipping address with empty matrikelnummer
1 parent 1f4ada5 commit 7e5ddb5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/os2forms_dawa/src/Plugin/os2web/DataLookup/DatafordelerDataLookup.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupBase;
1010
use GuzzleHttp\ClientInterface;
1111
use Symfony\Component\DependencyInjection\ContainerInterface;
12+
use TypeError;
1213

1314
/**
1415
* Defines a plugin for Datafordeler Data.
@@ -91,7 +92,12 @@ public function getMatrikulaEntries(string $matrikulaId) : array {
9192
if (NestedArray::keyExists($jsonDecoded, ['features', 0, 'properties', 'jordstykke'])) {
9293
$jordstykker = NestedArray::getValue($jsonDecoded, ['features', 0, 'properties', 'jordstykke']);
9394
foreach ($jordstykker as $jordstyk) {
94-
$matrikulaEntries[] = new DatafordelerMatrikula($jordstyk);
95+
try {
96+
$matrikulaEntries[] = new DatafordelerMatrikula($jordstyk);
97+
}
98+
catch (TypeError $e) {
99+
// Could not create matrikula object.
100+
}
95101
}
96102
}
97103
}

0 commit comments

Comments
 (0)