aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_encryption/lib/proxy.php9
1 files 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 );