Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 775-779 (lines=5) @@
772
				$share->setExpirationDate($expireDate);
773
			}
774
775
			if ($password === '') {
776
				$share->setPassword(null);
777
			} else if ($password !== null) {
778
				$share->setPassword($password);
779
			}
780
781
		} else {
782
			if ($permissions !== null) {
@@ 788-792 (lines=5) @@
785
			}
786
787
			if ($share->getShareType() === \OCP\Share::SHARE_TYPE_EMAIL) {
788
				if ($password === '') {
789
					$share->setPassword(null);
790
				} else if ($password !== null) {
791
					$share->setPassword($password);
792
				}
793
			}
794
795
			if ($expireDate === '') {