Index: bp-core-template.php
===================================================================
--- bp-core-template.php	(revision 7359)
+++ bp-core-template.php	(working copy)
@@ -814,61 +814,64 @@
 
 	$is_current_component = false;
 
-	// Backward compatibility: 'xprofile' should be read as 'profile'
-	if ( 'xprofile' == $component )
-		$component = 'profile';
+	if ( !empty( $component ) ) {
 
-	if ( !empty( $bp->current_component ) ) {
+		// Backward compatibility: 'xprofile' should be read as 'profile'
+		if ( 'xprofile' == $component )
+			$component = 'profile';
 
-		// First, check to see whether $component_name and the current
-		// component are a simple match
-		if ( $bp->current_component == $component ) {
-			$is_current_component = true;
+		if ( !empty( $bp->current_component ) ) {
 
-		// Since the current component is based on the visible URL slug let's
-		// check the component being passed and see if its root_slug matches
-		} elseif ( isset( $bp->{$component}->root_slug ) && $bp->{$component}->root_slug == $bp->current_component ) {
-			$is_current_component = true;
+			// First, check to see whether $component_name and the current
+			// component are a simple match
+			if ( $bp->current_component == $component ) {
+				$is_current_component = true;
 
-		// Because slugs can differ from root_slugs, we should check them too
-		} elseif ( isset( $bp->{$component}->slug ) && $bp->{$component}->slug == $bp->current_component ) {
-			$is_current_component = true;
+			// Since the current component is based on the visible URL slug let's
+			// check the component being passed and see if its root_slug matches
+			} elseif ( isset( $bp->{$component}->root_slug ) && $bp->{$component}->root_slug == $bp->current_component ) {
+				$is_current_component = true;
 
-		// Next, check to see whether $component is a canonical,
-		// non-translatable component name. If so, we can return its
-		// corresponding slug from $bp->active_components.
-		} else if ( $key = array_search( $component, $bp->active_components ) ) {
-			if ( strstr( $bp->current_component, $key ) ) {
+			// Because slugs can differ from root_slugs, we should check them too
+			} elseif ( isset( $bp->{$component}->slug ) && $bp->{$component}->slug == $bp->current_component ) {
 				$is_current_component = true;
-			}
 
-		// If we haven't found a match yet, check against the root_slugs
-		// created by $bp->pages, as well as the regular slugs
-		} else {
-			foreach ( $bp->active_components as $id ) {
-				// If the $component parameter does not match the current_component,
-				// then move along, these are not the droids you are looking for
-				if ( empty( $bp->{$id}->root_slug ) || $bp->{$id}->root_slug != $bp->current_component ) {
-					continue;
+			// Next, check to see whether $component is a canonical,
+			// non-translatable component name. If so, we can return its
+			// corresponding slug from $bp->active_components.
+			} else if ( $key = array_search( $component, $bp->active_components ) ) {
+				if ( strstr( $bp->current_component, $key ) ) {
+					$is_current_component = true;
 				}
 
-				if ( $id == $component ) {
-					$is_current_component = true;
-					break;
+			// If we haven't found a match yet, check against the root_slugs
+			// created by $bp->pages, as well as the regular slugs
+			} else {
+				foreach ( $bp->active_components as $id ) {
+					// If the $component parameter does not match the current_component,
+					// then move along, these are not the droids you are looking for
+					if ( empty( $bp->{$id}->root_slug ) || $bp->{$id}->root_slug != $bp->current_component ) {
+						continue;
+					}
+
+					if ( $id == $component ) {
+						$is_current_component = true;
+						break;
+					}
 				}
 			}
-		}
 
-	// Page template fallback check if $bp->current_component is empty
-	} elseif ( !is_admin() && is_page() ) {
-		global $wp_query;
-		$page          = $wp_query->get_queried_object();
-		$custom_fields = get_post_custom_values( '_wp_page_template', $page->ID );
-		$page_template = $custom_fields[0];
+		// Page template fallback check if $bp->current_component is empty
+		} elseif ( !is_admin() && is_page() ) {
+			global $wp_query;
+			$page          = $wp_query->get_queried_object();
+			$custom_fields = get_post_custom_values( '_wp_page_template', $page->ID );
+			$page_template = $custom_fields[0];
 
-		// Component name is in the page template name
-		if ( !empty( $page_template ) && strstr( strtolower( $page_template ), strtolower( $component ) ) ) {
-			$is_current_component = true;
+			// Component name is in the page template name
+			if ( !empty( $page_template ) && strstr( strtolower( $page_template ), strtolower( $component ) ) ) {
+				$is_current_component = true;
+			}
 		}
 	}
 
