Skip to content

Commit c4a16fe

Browse files
authored
Fixed extractConnection NULL issue
1 parent cec9833 commit c4a16fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/ConnectionPool.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,11 @@ public function getReadyConnection() {
144144
}
145145

146146
public function extractConnection() {
147-
return $this->getReadyConnection()->getThis()->onResolve(function($e, $conn) {
147+
$promise = $this->getReadyConnection()->getThis();
148+
$promise->onResolve(function($e, $conn) {
148149
$this->unmapConnection(spl_object_hash($conn));
149150
});
151+
return $promise;
150152
}
151153

152154
/* This method might be called multiple times with the same hash. Important is that it's unmapped immediately */
@@ -169,4 +171,4 @@ public function close() {
169171
$this->readyMap = [];
170172
$this->limit *= -1;
171173
}
172-
}
174+
}

0 commit comments

Comments
 (0)