{
$user = common_current_user();
- $searches = SearchSub::forProfile($user->getProfile());
+ if (!empty($user)) {
+ $searches = SearchSub::forProfile($user->getProfile());
- if (!empty($searches) && count($searches) > 0) {
- $searchSubMenu = new SearchSubMenu($menu->out, $user, $searches);
- $menu->submenu(_m('Searches'), $searchSubMenu);
+ if (!empty($searches) && count($searches) > 0) {
+ $searchSubMenu = new SearchSubMenu($menu->out, $user, $searches);
+ $menu->submenu(_m('Searches'), $searchSubMenu);
+ }
}
return true;
{
$user = common_current_user();
- $tags = TagSub::forProfile($user->getProfile());
+ if (!empty($user)) {
- if (!empty($tags) && count($tags) > 0) {
- $tagSubMenu = new TagSubMenu($menu->out, $user, $tags);
- $menu->submenu(_m('Tags'), $tagSubMenu);
+ $tags = TagSub::forProfile($user->getProfile());
+
+ if (!empty($tags) && count($tags) > 0) {
+ $tagSubMenu = new TagSubMenu($menu->out, $user, $tags);
+ $menu->submenu(_m('Tags'), $tagSubMenu);
+ }
}
return true;