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

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