summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-09-25 17:44:05 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-09-25 17:44:05 +0200
commit71bbb2ea8bd76697cc1785fe4324b54973c410b9 (patch)
tree9903960d9077c51d7a6344a640a9f81017030c81
parent2feb753b8437998c073849499ff86b427de06e62 (diff)
downloadnextcloud-server-71bbb2ea8bd76697cc1785fe4324b54973c410b9.tar.gz
nextcloud-server-71bbb2ea8bd76697cc1785fe4324b54973c410b9.zip
check if key exists before reading it
-rwxr-xr-xapps/files_encryption/lib/keymanager.php5
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;