--- project.module.old	2005-05-24 17:01:58.000000000 -0400
+++ project.module	2005-06-02 13:36:56.370296448 -0400
@@ -322,16 +322,33 @@
     // If browsing by version, see if this project has a release for this version. If so, get the latest.
     if ($version != -1) {
       $result2 = db_query_range("SELECT path, version, changed FROM {project_releases} WHERE nid = %d AND status = 1 AND path <> '' AND version LIKE '%s%%' ORDER BY created DESC", $node->nid, $version, 0, 1);
+      if (db_num_rows($result2)) {
+        $project = new StdClass();
+
+        $release = db_fetch_object($result2);
+        $project->nid = $node->nid;
+        $project->title = $node->title;
+        $project->term = $termname;
+        $project->version = $version;
+        $project->body = check_output($node->teaser, $node->format);
+
+        $project->links = array();
+        $project->links[] = l(t('Download'), $release->path);
+        $project->links[] = l(t('Find out more'), "node/$node->nid");
+        if ($node->issues) {
+          $project->links[] = l(t('Bugs and feature requests'), "project/issues/$node->nid");
+        }
+        $rows[] = array(theme('project_summary', $project));
+      }
+
     }
     // Otherwise display any project with at least one release. Get the latest release.
     else {
       $result2 = db_query_range("SELECT path, version, changed FROM {project_releases} WHERE nid = %d AND status = 1 AND created > 0 AND path <> '' ORDER BY created DESC", $node->nid, 0, 1);
-    }
-    // Did we find a release?
-    if (db_num_rows($result2)) {
-      $project = new StdClass();
-
+      if (db_num_rows($result2)) {
       $release = db_fetch_object($result2);
+      }
+      $project = new StdClass();
       $project->nid = $node->nid;
       $project->title = $node->title;
       $project->term = $termname;
@@ -339,7 +356,9 @@
       $project->body = check_output($node->teaser, $node->format);
 
       $project->links = array();
-      $project->links[] = l(t('Download'), $release->path);
+      if (db_num_rows($result2)) {
+        $project->links[] = l(t('Download'), $release->path);
+      }
       $project->links[] = l(t('Find out more'), "node/$node->nid");
       if ($node->issues) {
         $project->links[] = l(t('Bugs and feature requests'), "project/issues/$node->nid");
