diff --git a/lib/Cake/Cache/Engine/RedisEngine.php b/lib/Cake/Cache/Engine/RedisEngine.php index f66021fce..fb4f9c463 100644 --- a/lib/Cake/Cache/Engine/RedisEngine.php +++ b/lib/Cake/Cache/Engine/RedisEngine.php @@ -228,7 +228,7 @@ class RedisEngine extends CacheEngine { * Disconnects from the redis server */ public function __destruct() { - if (empty($this->settings['persistent'])) { + if (empty($this->settings['persistent']) && !is_null($this->_Redis)) { $this->_Redis->close(); } }