Code Duplication    Length = 7-8 lines in 2 locations

lib/private/Server.php 2 locations

@@ 961-967 (lines=7) @@
958
	 * @return \OCP\Files\Folder|null
959
	 */
960
	public function getUserFolder($userId = null) {
961
		if ($userId === null) {
962
			$user = $this->getUserSession()->getUser();
963
			if (!$user) {
964
				return null;
965
			}
966
			$userId = $user->getUID();
967
		}
968
		$root = $this->getRootFolder();
969
		return $root->getUserFolder($userId);
970
	}
@@ 1240-1247 (lines=8) @@
1237
	 * @return \OCP\ICertificateManager | null if $uid is null and no user is logged in
1238
	 */
1239
	public function getCertificateManager($userId = '') {
1240
		if ($userId === '') {
1241
			$userSession = $this->getUserSession();
1242
			$user = $userSession->getUser();
1243
			if (is_null($user)) {
1244
				return null;
1245
			}
1246
			$userId = $user->getUID();
1247
		}
1248
		return new CertificateManager($userId, new View(), $this->getConfig(), $this->getLogger());
1249
	}
1250