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

@@ 839-841 (lines=3) @@
836
			}
837
		} else {
838
			try {
839
				if (!add_entity_relationship($user_entity->getGUID(), "friendrequest", $friend->getGUID())) {
840
					return elgg_echo("friend_request:add:exists", array($friend->name));
841
				}
842
			} catch (Exception $e) {	//register_error calls insert_data which CAN raise Exceptions.
843
				return elgg_echo("friend_request:add:exists", array($friend->name));
844
			}