summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/util.php b/lib/util.php
index 81160d052..7aca4af8d 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -350,8 +350,11 @@ function common_current_user()
common_ensure_session();
$id = isset($_SESSION['userid']) ? $_SESSION['userid'] : false;
if ($id) {
- $_cur = User::staticGet($id);
- return $_cur;
+ $user = User::staticGet($id);
+ if ($user) {
+ $_cur = $user;
+ return $_cur;
+ }
}
}