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
	}
@@ 1271-1278 (lines=8) @@
1268
	 * @return \OCP\ICertificateManager | null if $uid is null and no user is logged in
1269
	 */
1270
	public function getCertificateManager($userId = '') {
1271
		if ($userId === '') {
1272
			$userSession = $this->getUserSession();
1273
			$user = $userSession->getUser();
1274
			if (is_null($user)) {
1275
				return null;
1276
			}
1277
			$userId = $user->getUID();
1278
		}
1279
		return new CertificateManager($userId, new View(), $this->getConfig());
1280
	}
1281