Skip to content

Commit 7b8fa74

Browse files
author
NDS
committed
Fix TypeError on first write attempt to ShmMap
1 parent 6522de4 commit 7b8fa74

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ShmMap.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,13 @@ public function getMap(): array
204204
return [];
205205
}
206206

207-
return unserialize(trim($read), ['allowed_classes' => false]);
207+
$map = unserialize(trim($read), ['allowed_classes' => false]);
208+
209+
if (!is_array($map)) {
210+
$map = [];
211+
}
212+
213+
return $map;
208214
}
209215

210216
/**

0 commit comments

Comments
 (0)