diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-09-25 17:44:05 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-09-25 17:44:05 +0200 |
commit | 71bbb2ea8bd76697cc1785fe4324b54973c410b9 (patch) | |
tree | 9903960d9077c51d7a6344a640a9f81017030c81 | |
parent | 2feb753b8437998c073849499ff86b427de06e62 (diff) | |
download | nextcloud-server-71bbb2ea8bd76697cc1785fe4324b54973c410b9.tar.gz nextcloud-server-71bbb2ea8bd76697cc1785fe4324b54973c410b9.zip |
check if key exists before reading it
-rwxr-xr-x | apps/files_encryption/lib/keymanager.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php index 9be3dda7ce3..7143fcff0f6 100755 --- a/apps/files_encryption/lib/keymanager.php +++ b/apps/files_encryption/lib/keymanager.php @@ -40,11 +40,14 @@ class Keymanager { public static function getPrivateKey(\OC_FilesystemView $view, $user) { $path = '/' . $user . '/' . 'files_encryption' . '/' . $user . '.private.key'; + $key = false; $proxyStatus = \OC_FileProxy::$enabled; \OC_FileProxy::$enabled = false; - $key = $view->file_get_contents($path); + if ($view->file_exists($path)) { + $key = $view->file_get_contents($path); + } \OC_FileProxy::$enabled = $proxyStatus; |