From b2bd441f42c0da11b57835fad636f4bcc06a3d1f Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 13 Jun 2019 18:11:31 +0200 Subject: [PATCH] Try using null file reference for unknown files --- src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php b/src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php index 3f09dd78..6845036f 100644 --- a/src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php +++ b/src/danog/MadelineProto/MTProtoTools/ReferenceDatabase.php @@ -539,6 +539,12 @@ class ReferenceDatabase implements TLCallback return $location['file_reference']; } + if (!$this->refresh) { + $this->API->logger->logger("Using null file reference for location of type $locationType object {$location['_']}", \danog\MadelineProto\Logger::ULTRA_VERBOSE); + + return 0; + } + throw new \danog\MadelineProto\Exception("Could not find file reference for location of type $locationType object {$location['_']}"); } $this->API->logger->logger("Getting file reference for location of type $locationType object {$location['_']}", \danog\MadelineProto\Logger::ULTRA_VERBOSE);