Skip to content

Commit 43ade40

Browse files
committed
Bugfix for trying to update contact with empty custom_fields
1 parent 35c63f2 commit 43ade40

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Picqer/Financials/Moneybird/Model.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,13 @@ private function getArrayWithNestedObjects($useAttributesAppend = true)
227227
$result[$attributeNameToUse] = (object)$result[$attributeNameToUse];
228228
}
229229
}
230+
231+
if (
232+
$multipleNestedEntities[$attributeName]['type'] === self::NESTING_TYPE_NESTED_OBJECTS
233+
&& empty($result[$attributeNameToUse])
234+
) {
235+
$result[$attributeNameToUse] = new \StdClass();
236+
}
230237
}
231238
}
232239

0 commit comments

Comments
 (0)