Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit 00a1bf4

Browse files
author
Fosco Marotto
committed
Merge pull request #179 from complex857/4.0-dev
Fix "Fatal error: Cannot use object of type stdClass as array"
2 parents ebde5ad + 0b7d22f commit 00a1bf4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Facebook/GraphObject.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ public function __construct($raw)
5050
$this->backingData = $raw;
5151

5252
if (isset($this->backingData['data']) && count($this->backingData) === 1) {
53-
$this->backingData = $this->backingData['data'];
53+
if ($this->backingData['data'] instanceof \stdClass) {
54+
$this->backingData = get_object_vars($this->backingData['data']);
55+
} else {
56+
$this->backingData = $this->backingData['data'];
57+
}
5458
}
5559
}
5660

0 commit comments

Comments
 (0)