Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 787-791 (lines=5) @@
784
				$share->setExpirationDate($expireDate);
785
			}
786
787
			if ($password === '') {
788
				$share->setPassword(null);
789
			} else if ($password !== null) {
790
				$share->setPassword($password);
791
			}
792
793
		} else {
794
			if ($permissions !== null) {
@@ 800-804 (lines=5) @@
797
			}
798
799
			if ($share->getShareType() === Share::SHARE_TYPE_EMAIL) {
800
				if ($password === '') {
801
					$share->setPassword(null);
802
				} else if ($password !== null) {
803
					$share->setPassword($password);
804
				}
805
			}
806
807
			if ($expireDate === '') {