From c0c4fe5fd3cd575656ed30b4464bb6bc3c6d4f40 Mon Sep 17 00:00:00 2001 From: Florin Peter Date: Thu, 16 May 2013 00:31:17 +0200 Subject: [PATCH] fix if file is not yet created --- apps/files_encryption/lib/proxy.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index 36d05d7e0fe..1d60770b4d7 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -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 );