Merge pull request #13002 from benjaminstout/issue-13001-redis-engine-undefined-index

Wrap index reference in empty() check - closes cakephp#13001
This commit is contained in:
Mark Sch 2019-02-21 22:54:25 +01:00 committed by GitHub
commit 307e11f507
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,7 +228,7 @@ class RedisEngine extends CacheEngine {
* Disconnects from the redis server
*/
public function __destruct() {
if (!$this->settings['persistent']) {
if (empty($this->settings['persistent']) && $this->_Redis !== null) {
$this->_Redis->close();
}
}