]> source.dussan.org Git - nextcloud-server.git/commitdiff
check if key exists before reading it
authorBjoern Schiessle <schiessle@owncloud.com>
Wed, 25 Sep 2013 15:44:05 +0000 (17:44 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Wed, 25 Sep 2013 15:44:05 +0000 (17:44 +0200)
apps/files_encryption/lib/keymanager.php

index 9be3dda7ce3f766a8d62054194bbaa419593952f..7143fcff0f63b7719849abc40f2450ed90179494 100755 (executable)
@@ -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;