Prevent attempting to close an uninitialized Redis instance (issue #13001)

This commit is contained in:
Benjamin Stout 2019-02-19 18:21:44 -08:00
parent d486e1ca9e
commit 0cc3509b74

View file

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