summaryrefslogtreecommitdiffstats
path: root/lib/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/user.php')
-rw-r--r--lib/user.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/user.php b/lib/user.php
index 908f2cbabfb..ee20f2e0971 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -316,7 +316,7 @@ class OC_User {
* @return string uid or false
*/
public static function getUser() {
- $uid = OC::$session->get('user_id');
+ $uid = OC::$session ? OC::$session->get('user_id') : null;
if (!is_null($uid)) {
return $uid;
} else {