Skip to content

Commit f4f1c2e

Browse files
committed
FIX check property
1 parent 4eb8b1b commit f4f1c2e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Models/Cube.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ class Cube extends Subdevice
1717
*/
1818
public function handleState($state)
1919
{
20+
if (!is_array($state)) {
21+
return;
22+
}
23+
2024
if (isset($state['rotate'])) {
2125
$this->status = 'rotate';
2226
$this->rotateDegrees = $state['rotate'];
2327
} else {
24-
$this->status = $state['status'];
28+
$this->status = $state['status'] ?? null;
2529
$this->rotateDegrees = null;
2630
}
2731

0 commit comments

Comments
 (0)