diff --git a/src/danog/MadelineProto/Db/MemoryArray.php b/src/danog/MadelineProto/Db/MemoryArray.php index 18132189..5951a32a 100644 --- a/src/danog/MadelineProto/Db/MemoryArray.php +++ b/src/danog/MadelineProto/Db/MemoryArray.php @@ -28,7 +28,7 @@ class MemoryArray extends \ArrayIterator implements DbArray public function offsetGet($offset): Promise { - return call(fn() => parent::offsetGet($offset)); + return call(fn() => parent::offsetExists($offset) ? parent::offsetGet($offset) : null); } public function offsetUnset($offset): Promise