diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index 4d5dc84e9c..debdf26ffd 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -83,6 +83,10 @@ if (empty($_POST['dirToken'])) { // The token defines the target directory (security reasons) $path = \OC\Files\Filesystem::getPath($linkItem['file_source']); + if($path === null) { + OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Unable to set upload directory.'))))); + die(); + } $dir = sprintf( "/%s/%s", $path,