diff --git a/modules/forum.module b/modules/forum.module
index 8589b4d0aa211cd3840fd443b9b1daae51b24a35..6a27f68555e815ee923c2e38b643061d4d1b015d 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -160,7 +160,8 @@ function forum_taxonomy($op, $type, $term = NULL) {
 
         // For containers, remove the tid from the forum_containers variable.
         $containers = variable_get('forum_containers', array());
-        if ($key = array_search($term['tid'], $containers)) {
+        $key = array_search($term['tid'], $containers);
+        if ($key !== FALSE) {
           unset($containers[$key]);
         }
         variable_set('forum_containers', $containers);
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 8589b4d0aa211cd3840fd443b9b1daae51b24a35..6a27f68555e815ee923c2e38b643061d4d1b015d 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -160,7 +160,8 @@ function forum_taxonomy($op, $type, $term = NULL) {
 
         // For containers, remove the tid from the forum_containers variable.
         $containers = variable_get('forum_containers', array());
-        if ($key = array_search($term['tid'], $containers)) {
+        $key = array_search($term['tid'], $containers);
+        if ($key !== FALSE) {
           unset($containers[$key]);
         }
         variable_set('forum_containers', $containers);