Code Duplication    Length = 15-15 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 1 location

@@ 882-896 (lines=15) @@
879
	 * @return \OCP\Files\File|\OCP\Files\Folder
880
	 * @throws InvalidShare
881
	 */
882
	private function getNode($userId, $id) {
883
		try {
884
			$userFolder = $this->rootFolder->getUserFolder($userId);
885
		} catch (NotFoundException $e) {
886
			throw new InvalidShare();
887
		}
888
889
		$nodes = $userFolder->getById($id);
890
891
		if (empty($nodes)) {
892
			throw new InvalidShare();
893
		}
894
895
		return $nodes[0];
896
	}
897
898
	/**
899
	 * A user is deleted from the system

apps/sharebymail/lib/ShareByMailProvider.php 1 location

@@ 739-753 (lines=15) @@
736
	 * @return \OCP\Files\File|\OCP\Files\Folder
737
	 * @throws InvalidShare
738
	 */
739
	private function getNode($userId, $id) {
740
		try {
741
			$userFolder = $this->rootFolder->getUserFolder($userId);
742
		} catch (NotFoundException $e) {
743
			throw new InvalidShare();
744
		}
745
746
		$nodes = $userFolder->getById($id);
747
748
		if (empty($nodes)) {
749
			throw new InvalidShare();
750
		}
751
752
		return $nodes[0];
753
	}
754
755
	/**
756
	 * A user is deleted from the system