Code Duplication    Length = 3-4 lines in 2 locations

mod/friend_request/actions/friends/add.php 1 location

@@ 76-79 (lines=4) @@
73
		}
74
	} else {
75
		try {
76
			if (!add_entity_relationship($user->getGUID(), "friendrequest", $friend->getGUID())) {
77
				$errors = true;
78
				register_error(elgg_echo("friend_request:add:exists", array($friend->name)));
79
			}
80
		} catch (Exception $e) {	//register_error calls insert_data which CAN raise Exceptions.
81
			$errors = true;
82
			register_error(elgg_echo("friend_request:add:exists", array($friend->name)));

mod/gc_mobile_api/models/user.php 1 location

@@ 1044-1046 (lines=3) @@
1041
			}
1042
		} else {
1043
			try {
1044
				if (!add_entity_relationship($user_entity->getGUID(), "friendrequest", $friend->getGUID())) {
1045
					return elgg_echo("friend_request:add:exists", array($friend->name));
1046
				}
1047
			} catch (Exception $e) {	//register_error calls insert_data which CAN raise Exceptions.
1048
				return elgg_echo("friend_request:add:exists", array($friend->name));
1049
			}