Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit 0cc3509

Browse files
author
Benjamin Stout
committed
Prevent attempting to close an uninitialized Redis instance (issue #13001)
1 parent d486e1c commit 0cc3509

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Cake/Cache/Engine/RedisEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function clearGroup($group) {
228228
* Disconnects from the redis server
229229
*/
230230
public function __destruct() {
231-
if (empty($this->settings['persistent'])) {
231+
if (empty($this->settings['persistent']) && !is_null($this->_Redis)) {
232232
$this->_Redis->close();
233233
}
234234
}

0 commit comments

Comments
 (0)