From 69a0e80050a0463ab7666c5ba54d760fbd337fcb Mon Sep 17 00:00:00 2001 From: Paul McCrodden Date: Mon, 15 Jun 2015 11:56:31 +0100 Subject: [PATCH] Issue: #2505523 by mccrodp: Added extra check for user id on user object obtained via page argument --- message_private.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message_private.module b/message_private.module index c339a22..a8fcc97 100755 --- a/message_private.module +++ b/message_private.module @@ -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);