Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 764-768 (lines=5) @@
761
				$share->setExpirationDate($expireDate);
762
			}
763
764
			if ($password === '') {
765
				$share->setPassword(null);
766
			} else if ($password !== null) {
767
				$share->setPassword($password);
768
			}
769
770
		} else {
771
			if ($permissions !== null) {
@@ 777-781 (lines=5) @@
774
			}
775
776
			if ($share->getShareType() === \OCP\Share::SHARE_TYPE_EMAIL) {
777
				if ($password === '') {
778
					$share->setPassword(null);
779
				} else if ($password !== null) {
780
					$share->setPassword($password);
781
				}
782
			}
783
784
			if ($expireDate === '') {