diff --git a/html/inc/forum.inc b/html/inc/forum.inc
index 8adce7a1fe..93e359a613 100644
--- a/html/inc/forum.inc
+++ b/html/inc/forum.inc
@@ -214,8 +214,10 @@ function show_post($post, $thread, $logged_in_user, $n, $controls=FORUM_CONTROLS
$user = $post->getOwner();
global $no_forum_rating;
+ if ($logged_in_user) {
+ $tokens = url_tokens($logged_in_user->getAuthenticator());
+ }
- $tokens = url_tokens($logged_in_user->getAuthenticator());
//If the user that made this post is on the list of people to ignore, change thresholds to be much more strict
if ($logged_in_user){
if (in_array($user->getID(),$logged_in_user->getIgnoreList())){
diff --git a/html/user/forum_thread.php b/html/user/forum_thread.php
index df03084a2d..1e2adbba6c 100644
--- a/html/user/forum_thread.php
+++ b/html/user/forum_thread.php
@@ -18,7 +18,9 @@ if ($filter != "false"){
}
$logged_in_user = re_get_logged_in_user(false);
-$tokens = url_tokens($logged_in_user->getAuthenticator());
+if ($logged_in_user) {
+ $tokens = url_tokens($logged_in_user->getAuthenticator());
+}
// Fetch the thread and increment the number of views
$thread = new Thread($threadid);