Skip to content

Commit 9cf91be

Browse files
bruceoutdoorsvearutop
authored andcommitted
skip uninitialized properties
1 parent 0ee6870 commit 9cf91be

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Structure/ClassStructureTrait.php

+5
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ public function jsonSerialize()
104104
$processed = array();
105105
if (null !== $properties) {
106106
foreach ($properties->getDataKeyMap() as $propertyName => $dataName) {
107+
if (!isset($this->$propertyName)) {
108+
// Skip uninitialized properties
109+
continue;
110+
}
111+
107112
$value = $this->$propertyName;
108113

109114
// Value is exported if exists.

0 commit comments

Comments
 (0)