Skip to content

Commit 6451450

Browse files
author
Ian Barber
committed
Check for presence of val in data array
In model. I think this simpler patch should accomplish the same as issue 44.
1 parent bc8c2e6 commit 6451450

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Google/Model.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ public function __get($key)
4646
$keyTypeName = $this->keyType($key);
4747
$keyDataType = $this->dataType($key);
4848
if (isset($this->$keyTypeName) && !isset($this->processed[$key])) {
49-
$val = $this->data[$key];
49+
if (isset($this->data[$key])) {
50+
$val = $this->data[$key];
51+
} else {
52+
$val = null;
53+
}
54+
5055
if ($this->isAssociativeArray($val)) {
5156
if (isset($this->$keyDataType) && 'map' == $this->$keyDataType) {
5257
foreach ($val as $arrayKey => $arrayItem) {

0 commit comments

Comments
 (0)