Code Duplication    Length = 5-5 lines in 2 locations

apps/files_sharing/lib/Controller/ShareAPIController.php 2 locations

@@ 847-851 (lines=5) @@
844
				$share->setExpirationDate($expireDate);
845
			}
846
847
			if ($password === '') {
848
				$share->setPassword(null);
849
			} else if ($password !== null) {
850
				$share->setPassword($password);
851
			}
852
853
		} else {
854
			if ($permissions !== null) {
@@ 860-864 (lines=5) @@
857
			}
858
859
			if ($share->getShareType() === Share::SHARE_TYPE_EMAIL) {
860
				if ($password === '') {
861
					$share->setPassword(null);
862
				} else if ($password !== null) {
863
					$share->setPassword($password);
864
				}
865
866
				if ($sendPasswordByTalk === 'true') {
867
					if (!$this->appManager->isEnabledForUser('spreed')) {