Skip to content

Commit 5ab9bd1

Browse files
committed
Fixed 2 Errors that were caused by UNSET variables
1 parent 2b8fc32 commit 5ab9bd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Google/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Google_Collection extends Google_Model implements Iterator, Countable
1313

1414
public function rewind()
1515
{
16-
if (is_array($this->modelData[$this->collection_key])) {
16+
if (isset($this->modelData[$this->collection_key]) && is_array($this->modelData[$this->collection_key])) {
1717
reset($this->modelData[$this->collection_key]);
1818
}
1919
}
@@ -28,7 +28,7 @@ public function current()
2828

2929
public function key()
3030
{
31-
if (is_array($this->modelData[$this->collection_key])) {
31+
if (isset($this->modelData[$this->collection_key]) && is_array($this->modelData[$this->collection_key])) {
3232
return key($this->modelData[$this->collection_key]);
3333
}
3434
}

0 commit comments

Comments
 (0)