aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-09-25 17:44:05 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-09-26 11:06:58 +0200
commit4d2dfa98c0e96f7829127744a741b03819a1666a (patch)
tree5f1a37f0f7d9b96b61b7f2dea65172960fbbd461
parent4077ed6ddbd11a4013284ea1a15455a68827f16d (diff)
downloadnextcloud-server-4d2dfa98c0e96f7829127744a741b03819a1666a.tar.gz
nextcloud-server-4d2dfa98c0e96f7829127744a741b03819a1666a.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 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;