diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index fd24fc686b1acb986718d49b54eb34fcd0ebd26c..71390d999662b3ba1ce6d03059762a2c15201773 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -127,8 +127,8 @@ class Share extends Constants {
 		$cache = false;
 
 		$view = new \OC\Files\View('/' . $ownerUser . '/files');
-		if ($view->file_exists($path)) {
-			$meta = $view->getFileInfo($path);
+		$meta = $view->getFileInfo($path);
+		if ($meta) {
 			$path = substr($meta->getPath(), strlen('/' . $ownerUser . '/files'));
 		} else {
 			// if the file doesn't exists yet we start with the parent folder