Index: project.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project/project.module,v
retrieving revision 1.292
diff -u -F^f -r1.292 project.module
--- project.module	24 Aug 2007 04:31:30 -0000	1.292
+++ project.module	25 Aug 2007 16:27:46 -0000
@@ -530,6 +530,10 @@ function project_page_overview($termname
     if ($termname) {
 
       $type = db_fetch_object(db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE t.vid = %d AND t.name = '%s'", 't', 'tid'), $vid, $termname));
+      // Bad project category passed, return page not found.
+      if (!$type) {
+        return drupal_not_found();
+      }
       if (!$sort_method) {
         // For the default, we use the overall default if enabled for this term, and if not we use the first enabled method.
         $term_methods = array_filter(variable_get('project_sort_method_used_' . $type->tid, array_keys($sort_methods)));
@@ -584,8 +588,12 @@ function project_page_overview($termname
           }
         }
 
-        if (arg(3) && is_numeric(arg(3))) {
-          $term = taxonomy_get_term(arg(3));
+        // Look for a specific category term.
+        if ($arg = arg(3)) {
+          // Bad term, return page not found.
+          if (!($term = taxonomy_get_term($arg))) {
+            return drupal_not_found();
+          }
         }
       }
 
