Log errors only if the logger is constructed

This commit is contained in:
Daniil Gentili 2017-01-29 18:52:48 +01:00
parent c5340d4565
commit 896956fe78

View File

@ -25,7 +25,7 @@ class Exception extends \Exception
if (error_reporting() === 0) {
return true; // return true to continue through the others error handlers
}
\danog\MadelineProto\Logger::log([$errstr], \danog\MadelineProto\Logger::FATAL_ERROR);
if (\danog\MadelineProto\Logger::$constructed) \danog\MadelineProto\Logger::log([$errstr], \danog\MadelineProto\Logger::FATAL_ERROR);
$e = new \danog\MadelineProto\Exception($errstr, $errno);
$e->file = $errfile;
$e->line = $errline;