Skip to content

Commit bbe14ae

Browse files
committed
Handling nicely if childless person
1 parent 84c97e0 commit bbe14ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Plugin/os2web/DataLookup/ServiceplatformenCPRExtended.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ public function lookup($cpr, $allowCprTestModeReplace = TRUE) {
115115
}
116116

117117
$relationship = $result['relationer'];
118-
if ($relationship->barn && is_array($relationship->barn)) {
118+
if (isset($relationship->barn) && is_array($relationship->barn)) {
119119
$children = [];
120120
foreach ($relationship->barn as $child) {
121121
$childCprResult = $this->lookup($child->personnummer, FALSE);
122122

123123
$children[] = [
124124
'cpr' => $childCprResult->getCpr(),
125-
'name' => $childCprResult->getName()
125+
'name' => $childCprResult->getName(),
126126
];
127127
}
128128
$cprResult->setChildren($children);

0 commit comments

Comments
 (0)