Don't throw exception when user not found

It might be a public link share.

(cherry picked from commit 3f4aa7b23ec997457e244fa94464b11dfe08aa08)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
This commit is contained in:
Pranav Kant 2017-06-01 23:26:50 +05:30 committed by Andras Timar
parent 57f6a5ba32
commit 2c1dd44651

View File

@ -180,10 +180,9 @@ class WopiController extends Controller {
// Set the user to register the change under his name // Set the user to register the change under his name
$editor = \OC::$server->getUserManager()->get($res['editor']); $editor = \OC::$server->getUserManager()->get($res['editor']);
if (is_null($editor)) { if (!is_null($editor)) {
throw new \OC\User\NoUserException("User " . $res['editor'] . "not found."); \OC::$server->getUserSession()->setUser($editor);
} }
\OC::$server->getUserSession()->setUser($editor);
$file->putContent($content); $file->putContent($content);
return new JSONResponse(); return new JSONResponse();