diff --git a/mod/forum/view.php b/mod/forum/view.php
index e68da7e5132..356a1f42b6b 100644
--- a/mod/forum/view.php
+++ b/mod/forum/view.php
@@ -80,7 +80,7 @@
echo '
'; // forum-view wrapper start
- if (!$cm->visible and !isteacher($course->id)) {
+ if (empty($cm->visible) and !isteacher($course->id)) {
notice(get_string("activityiscurrentlyhidden"));
}