From 2039667f825f04c0b7c49b02ce6f67227be4af69 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 30 May 2019 17:27:22 +0200 Subject: [PATCH] Minor bugfix --- src/danog/MadelineProto/MTProtoTools/ResponseHandler.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php index 5f8d4c62..cfbe0db1 100644 --- a/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/ResponseHandler.php @@ -301,8 +301,13 @@ trait ResponseHandler { if (isset($request['promise']) && is_object($request['promise'])) { Loop::defer(function () use (&$request, $data) { - $request['promise']->fail($data); - unset($request['promise']); + if (isset($request['promise'])) { + $request['promise']->fail($data); + unset($request['promise']); + } else { + $this->logger->logger('Rejecting: already got response for '.(isset($request['_']) ? $request['_'] : '-')); + $this->logger->logger("Rejecting: $data"); + } }); } elseif (isset($request['container'])) { foreach ($request['container'] as $message_id) {