===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/bio/bio.module,v
retrieving revision 1.2.2.24
diff -u -p -r1.2.2.24 bio.module
--- bio.module	28 Jan 2008 07:41:21 -0000	1.2.2.24
+++ bio.module	28 Jan 2008 08:28:19 -0000
@@ -247,8 +247,6 @@ function bio_nodeapi(&$node, $op, $a3 = 
       // Remove the user's entry from the bio table when the user is deleted.
       db_query('DELETE FROM {bio} where nid = %d', $node->nid);
       break;
-
-
   }
 }
 
@@ -256,14 +254,19 @@ function bio_nodeapi(&$node, $op, $a3 = 
  * Implementation hook_user().
  */
 function bio_user($op, &$edit, &$account, $category = NULL) {
-  if (!variable_get('bio_profile', 0)) return;
+  // If there's no bio for this user, nothing to do here.
+  if (!$nid = bio_for_user($account->uid)) {
+    return;
+  }
 
   switch ($op) {
     case 'view':
-      // Add bio to main user profile page.
-      if (!$nid = bio_for_user($account->uid)) return;
-      if (!node_access('view', $node = node_load($nid))) return;
-      return array(node_get_types('name', bio_get_type()) => array('bio' => array('value' => node_view($node, FALSE, TRUE, FALSE))));
+      // Add bio to main user profile page, if option is enabled and bio is accessible.
+      if (variable_get('bio_profile', 0) && node_access('view', $node = node_load($nid))) {
+        $name = node_get_types('name', bio_get_type());
+        $bio[$name]['bio']['value'] = node_view($node, FALSE, TRUE, FALSE);
+        return $bio;
+      }
       break;
     case 'delete':
       node_delete(bio_for_user($account->uid));
Index: tests/bio.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/bio/tests/Attic/bio.test,v
retrieving revision 1.1.2.8
diff -u -p -r1.1.2.8 bio.test
--- tests/bio.test	25 Jan 2008 09:33:51 -0000	1.1.2.8
+++ tests/bio.test	28 Jan 2008 08:28:19 -0000
@@ -178,10 +178,15 @@ class BioTest extends DrupalTestCase {
     $this->drupalPostRequest("user/$uid/bio", array('name' => $this->admin_user->name), t('Submit'));
     $nid = bio_for_user($this->admin_user->uid);
     $this->assertFalse($nid, t('Checking for inability to edit author on bio node'));
+
+    // TODO: Check with user who doesn't have access to node.
   }
 
   /**
    * Test "takeover profile" option.
+   * 
+   * @todo: this test fails when bio_profile variable is disabled.
+   * I think I might be checking the wrong thing.
    */
   function testBioTakeoverProfile() {
     $this->drupalVariableSet('bio_takeover', 1);
