diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-09-25 17:44:05 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-09-26 11:06:58 +0200 |
commit | 4d2dfa98c0e96f7829127744a741b03819a1666a (patch) | |
tree | 5f1a37f0f7d9b96b61b7f2dea65172960fbbd461 | |
parent | 4077ed6ddbd11a4013284ea1a15455a68827f16d (diff) | |
download | nextcloud-server-4d2dfa98c0e96f7829127744a741b03819a1666a.tar.gz nextcloud-server-4d2dfa98c0e96f7829127744a741b03819a1666a.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 5386de486e1..6863b0871c7 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; |