diff --git a/html/inc/forum.inc b/html/inc/forum.inc
index 3d1606bf9c..c9e8e44326 100644
--- a/html/inc/forum.inc
+++ b/html/inc/forum.inc
@@ -457,6 +457,10 @@ function show_post(
if (is_banished($user) && !is_moderator($logged_in_user, $forum)) {
return;
}
+ // If the user no longer exists, skip the post
+ if (!$user){
+ return;
+ }
$config = get_config();
$no_forum_rating = parse_bool($config, "no_forum_rating");
@@ -513,7 +517,7 @@ function show_post(
$fstatus="";
$keys = array_keys($special_user_bitfield);
for ($i=0; $iprefs->privilege($keys[$i])) {
+ if ($user->prefs && $user->prefs->privilege($keys[$i])) {
$fstatus.=$special_user_bitfield[$keys[$i]]."
";
}
}
@@ -522,7 +526,7 @@ function show_post(
echo "";
if (!$filter || !$rated_below_threshold){
- if ($user->prefs->avatar!="" && (!$logged_in_user || ($logged_in_user->prefs->hide_avatars==false))) {
+ if ($user->prefs && $user->prefs->avatar!="" && (!$logged_in_user || ($logged_in_user->prefs->hide_avatars==false))) {
echo "prefs->avatar."\" alt=\"Avatar\">
";
}
}