diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index d9af9807..93e2c2d2 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -497,7 +497,7 @@ class MTProto extends AsyncConstruct implements TLCallback */ public function serializeSession(object $data): \Generator { - if ($this->session instanceof MemoryArray) { + if (!$this->session || $this->session instanceof MemoryArray) { return $data; } yield $this->session['data'] = \serialize($data);