Skip to content

Commit

Permalink
Issue: #2505523 by mccrodp: Added extra check for user id on user obj…
Browse files Browse the repository at this point in the history
…ect obtained via page argument
  • Loading branch information
mccrodp committed Jun 15, 2015
1 parent f4fccc1 commit 69a0e80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion message_private.module
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function message_private_menu_local_tasks_alter(&$data, $router_item, $root_path
$to_user = array_shift($router_item['page_arguments']);
}
// Only display the local task on other users profile, not current user's.
if (!empty($to_user) && $user->uid != $to_user->uid) {
if (!empty($to_user) && !empty($to_user->uid) && $user->uid != $to_user->uid) {
$item = menu_get_item('message/create/private-message');
$item['title'] = t('Create a new message for') . ' ' . $to_user->name;
$item['localized_options']['query'] = array('field_message_user_ref' => $to_user->uid);
Expand Down

0 comments on commit 69a0e80

Please sign in to comment.