Skip to content

Commit 9306cbe

Browse files
authored
The server going away may cause it to send an error packet
1 parent 0204d14 commit 9306cbe

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/Processor.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,12 @@ private function handleError($packet) {
390390
$this->parseCallback = null;
391391
if ($this->connectionState == self::READY) {
392392
// normal error
393-
if ($this->config->exceptions) {
394-
$this->getDeferred()->fail(new QueryException("MySQL error ({$this->connInfo->errorCode}): {$this->connInfo->errorState} {$this->connInfo->errorMsg}", $this->query));
395-
} else {
396-
$this->getDeferred()->resolve(false);
393+
if ($deferred = $this->getDeferred()) {
394+
if ($this->config->exceptions) {
395+
$deferred->fail(new QueryException("MySQL error ({$this->connInfo->errorCode}): {$this->connInfo->errorState} {$this->connInfo->errorMsg}", $this->query));
396+
} else {
397+
$deferred->resolve(false);
398+
}
397399
}
398400
$this->query = null;
399401
$this->ready();

0 commit comments

Comments
 (0)