From 68115581d092356496100809311bf6c8a0868417 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 20 Jan 2017 22:22:05 +0000 Subject: [PATCH] Avoiding some error messages --- include/session.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/session.php b/include/session.php index 31024060f3..055bfcb4ef 100644 --- a/include/session.php +++ b/include/session.php @@ -64,8 +64,9 @@ function ref_session_write($id, $data) { $default_expire = time() + 300; $memcache = cache::memcache(); - if (is_object($memcache)) { - $memcache->set(get_app()->get_hostname().":session:".$id, $data, MEMCACHE_COMPRESSED, $expire); + $a = get_app(); + if (is_object($memcache) AND is_object($a)) { + $memcache->set($a->get_hostname().":session:".$id, $data, MEMCACHE_COMPRESSED, $expire); return true; }