Code Duplication    Length = 7-8 lines in 2 locations

lib/private/Server.php 2 locations

@@ 844-850 (lines=7) @@
841
	 * @return \OCP\Files\Folder|null
842
	 */
843
	public function getUserFolder($userId = null) {
844
		if ($userId === null) {
845
			$user = $this->getUserSession()->getUser();
846
			if (!$user) {
847
				return null;
848
			}
849
			$userId = $user->getUID();
850
		}
851
		$root = $this->getRootFolder();
852
		return $root->getUserFolder($userId);
853
	}
@@ 1123-1130 (lines=8) @@
1120
	 * @return \OCP\ICertificateManager | null if $uid is null and no user is logged in
1121
	 */
1122
	public function getCertificateManager($userId = '') {
1123
		if ($userId === '') {
1124
			$userSession = $this->getUserSession();
1125
			$user = $userSession->getUser();
1126
			if (is_null($user)) {
1127
				return null;
1128
			}
1129
			$userId = $user->getUID();
1130
		}
1131
		return new CertificateManager($userId, new View(), $this->getConfig());
1132
	}
1133