fix if file is not yet created

This commit is contained in:
Florin Peter 2013-05-16 00:31:17 +02:00
parent 8f963b95e5
commit c0c4fe5fd3
1 changed files with 7 additions and 2 deletions

View File

@ -131,8 +131,13 @@ class Proxy extends \OC_FileProxy {
$encData = Crypt::symmetricEncryptFileContent( $data, $plainKey );
$sharingEnabled = \OCP\Share::isEnabled();
$uniqueUserIds = $util->getSharingUsersArray( $sharingEnabled, $filePath, $userId );
// if file exists try to get sharing users
if($view->file_exists($path)) {
$uniqueUserIds = $util->getSharingUsersArray( $sharingEnabled, $filePath, $userId );
} else {
$uniqueUserIds[] = $userId;
}
// Fetch public keys for all users who will share the file
$publicKeys = Keymanager::getPublicKeys( $view, $uniqueUserIds );